mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Added coding framework for X11
Former-commit-id: 2915defe12e23d328716eade251849d40d098a8a
This commit is contained in:
parent
b4c49c9ec4
commit
2d7d18b34d
@ -7,15 +7,18 @@ cmake_minimum_required(VERSION 2.8)
|
||||
#set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake)
|
||||
|
||||
# set the build options
|
||||
option (ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
|
||||
option (ENABLE_SPIDEV "Enable the SPIDEV device" ON)
|
||||
|
||||
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
|
||||
message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX})
|
||||
|
||||
option(ENABLE_SPIDEV "Enable the SPIDEV device" ON)
|
||||
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
|
||||
|
||||
option (ENABLE_V4L2 "Enable the V4L2 grabber" ON)
|
||||
option(ENABLE_V4L2 "Enable the V4L2 grabber" ON)
|
||||
message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
|
||||
|
||||
option(ENABLE_X11 "Enable the X11 grabber" ON)
|
||||
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
|
||||
|
||||
# Createt the configuration file
|
||||
# configure a header file to pass some of the CMake settings
|
||||
# to the source code
|
||||
|
@ -1,5 +1,12 @@
|
||||
add_subdirectory(hyperiond)
|
||||
add_subdirectory(hyperion-remote)
|
||||
if (ENABLE_V4L2)
|
||||
|
||||
# Add the 'Video 4 Linux' grabber if it is enabled
|
||||
if(ENABLE_V4L2)
|
||||
add_subdirectory(hyperion-v4l2)
|
||||
endif (ENABLE_V4L2)
|
||||
endif(ENABLE_V4L2)
|
||||
|
||||
# Add the X11 grabber if it is enabled
|
||||
if(ENABLE_X11)
|
||||
add_subdirectory(hyperion-x11)
|
||||
endif(ENABLE_X11)
|
||||
|
55
src/hyperion-x11/CMakeLists.txt
Normal file
55
src/hyperion-x11/CMakeLists.txt
Normal file
@ -0,0 +1,55 @@
|
||||
# Configure minimum CMAKE version
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# Set the project name
|
||||
project(hyperion-x11)
|
||||
|
||||
# add protocol buffers
|
||||
find_package(Protobuf REQUIRED)
|
||||
|
||||
# find Qt4
|
||||
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${PROTOBUF_INCLUDE_DIRS}
|
||||
${QT_INCLUDES}
|
||||
)
|
||||
|
||||
set(Hyperion_X11_HEADERS
|
||||
X11Grabber.h
|
||||
../hyperion-v4l2/ProtoConnection.h
|
||||
)
|
||||
|
||||
set(Hyperion_X11_SOURCES
|
||||
X11Grabber.cpp
|
||||
../hyperion-v4l2/ProtoConnection.cpp
|
||||
)
|
||||
|
||||
set(Hyperion_X11_PROTOS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../libsrc/protoserver/message.proto
|
||||
)
|
||||
|
||||
protobuf_generate_cpp(Hyperion_X11_PROTO_SRCS Hyperion_X11_PROTO_HDRS
|
||||
${Hyperion_X11_PROTOS}
|
||||
)
|
||||
|
||||
add_executable(hyperion-x11
|
||||
${Hyperion_X11_HEADERS}
|
||||
${Hyperion_X11_SOURCES}
|
||||
${Hyperion_X11_PROTO_SRCS}
|
||||
${Hyperion_X11_PROTO_HDRS}
|
||||
)
|
||||
|
||||
target_link_libraries(hyperion-x11
|
||||
getoptPlusPlus
|
||||
blackborder
|
||||
hyperion-utils
|
||||
${PROTOBUF_LIBRARIES}
|
||||
pthread
|
||||
)
|
||||
|
||||
qt4_use_modules(hyperion-x11
|
||||
Core
|
||||
Gui
|
||||
Network)
|
14
src/hyperion-x11/X11Grabber.cpp
Normal file
14
src/hyperion-x11/X11Grabber.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
int main(int argc, char ** argv)
|
||||
{
|
||||
Display * dspl;
|
||||
Drawable drwbl;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
|
||||
XImage * xImage = XGetImage(dspl, drwbl, x, y, width, height, AllPlanes, ZPixmap);
|
||||
}
|
0
src/hyperion-x11/X11Grabber.h
Normal file
0
src/hyperion-x11/X11Grabber.h
Normal file
Loading…
Reference in New Issue
Block a user