diff --git a/CMakeLists.txt b/CMakeLists.txt index b6b9ed3c..36fc2e56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b06b4ee7..16c88d77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/hyperion-x11/CMakeLists.txt b/src/hyperion-x11/CMakeLists.txt new file mode 100644 index 00000000..5b4fd821 --- /dev/null +++ b/src/hyperion-x11/CMakeLists.txt @@ -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) diff --git a/src/hyperion-x11/X11Grabber.cpp b/src/hyperion-x11/X11Grabber.cpp new file mode 100644 index 00000000..d1331743 --- /dev/null +++ b/src/hyperion-x11/X11Grabber.cpp @@ -0,0 +1,14 @@ + +#include + +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); +} diff --git a/src/hyperion-x11/X11Grabber.h b/src/hyperion-x11/X11Grabber.h new file mode 100644 index 00000000..e69de29b