Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.

Commit 2915def

Browse files
committed
Added coding framework for X11
1 parent e21a530 commit 2915def

File tree

5 files changed

+85
-6
lines changed

5 files changed

+85
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@ cmake_minimum_required(VERSION 2.8)
77
#set(CMAKE_TOOLCHAIN_FILE /opt/raspberrypi/Toolchain-RaspberryPi.cmake)
88

99
# set the build options
10-
option (ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
11-
option (ENABLE_SPIDEV "Enable the SPIDEV device" ON)
12-
10+
option(ENABLE_DISPMANX "Enable the RPi dispmanx grabber" ON)
1311
message(STATUS "ENABLE_DISPMANX = " ${ENABLE_DISPMANX})
12+
13+
option(ENABLE_SPIDEV "Enable the SPIDEV device" ON)
1414
message(STATUS "ENABLE_SPIDEV = " ${ENABLE_SPIDEV})
1515

16-
option (ENABLE_V4L2 "Enable the V4L2 grabber" ON)
16+
option(ENABLE_V4L2 "Enable the V4L2 grabber" ON)
1717
message(STATUS "ENABLE_V4L2 = " ${ENABLE_V4L2})
1818

19+
option(ENABLE_X11 "Enable the X11 grabber" ON)
20+
message(STATUS "ENABLE_X11 = " ${ENABLE_X11})
21+
1922
# Createt the configuration file
2023
# configure a header file to pass some of the CMake settings
2124
# to the source code

src/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
add_subdirectory(hyperiond)
22
add_subdirectory(hyperion-remote)
3-
if (ENABLE_V4L2)
3+
4+
# Add the 'Video 4 Linux' grabber if it is enabled
5+
if(ENABLE_V4L2)
46
add_subdirectory(hyperion-v4l2)
5-
endif (ENABLE_V4L2)
7+
endif(ENABLE_V4L2)
8+
9+
# Add the X11 grabber if it is enabled
10+
if(ENABLE_X11)
11+
add_subdirectory(hyperion-x11)
12+
endif(ENABLE_X11)

src/hyperion-x11/CMakeLists.txt

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Configure minimum CMAKE version
2+
cmake_minimum_required(VERSION 2.8)
3+
4+
# Set the project name
5+
project(hyperion-x11)
6+
7+
# add protocol buffers
8+
find_package(Protobuf REQUIRED)
9+
10+
# find Qt4
11+
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork)
12+
13+
include_directories(
14+
${CMAKE_CURRENT_BINARY_DIR}
15+
${PROTOBUF_INCLUDE_DIRS}
16+
${QT_INCLUDES}
17+
)
18+
19+
set(Hyperion_X11_HEADERS
20+
X11Grabber.h
21+
../hyperion-v4l2/ProtoConnection.h
22+
)
23+
24+
set(Hyperion_X11_SOURCES
25+
X11Grabber.cpp
26+
../hyperion-v4l2/ProtoConnection.cpp
27+
)
28+
29+
set(Hyperion_X11_PROTOS
30+
${CMAKE_CURRENT_SOURCE_DIR}/../../libsrc/protoserver/message.proto
31+
)
32+
33+
protobuf_generate_cpp(Hyperion_X11_PROTO_SRCS Hyperion_X11_PROTO_HDRS
34+
${Hyperion_X11_PROTOS}
35+
)
36+
37+
add_executable(hyperion-x11
38+
${Hyperion_X11_HEADERS}
39+
${Hyperion_X11_SOURCES}
40+
${Hyperion_X11_PROTO_SRCS}
41+
${Hyperion_X11_PROTO_HDRS}
42+
)
43+
44+
target_link_libraries(hyperion-x11
45+
getoptPlusPlus
46+
blackborder
47+
hyperion-utils
48+
${PROTOBUF_LIBRARIES}
49+
pthread
50+
)
51+
52+
qt4_use_modules(hyperion-x11
53+
Core
54+
Gui
55+
Network)

src/hyperion-x11/X11Grabber.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
#include <X11/Xlib.h>
3+
4+
int main(int argc, char ** argv)
5+
{
6+
Display * dspl;
7+
Drawable drwbl;
8+
int x = 0;
9+
int y = 0;
10+
int width = 0;
11+
int height = 0;
12+
13+
XImage * xImage = XGetImage(dspl, drwbl, x, y, width, height, AllPlanes, ZPixmap);
14+
}

src/hyperion-x11/X11Grabber.h

Whitespace-only changes.

0 commit comments

Comments
 (0)