summaryrefslogtreecommitdiff
path: root/elements/gstqtvideosink/CMakeLists.txt
blob: 6808a25a962fd138c29c387bbbc242d75253e219 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
glib2_genmarshal(gstqtvideosinkmarshal
    VOID:POINTER,FLOAT,FLOAT,FLOAT,FLOAT
    VOID:POINTER,DOUBLE,DOUBLE,DOUBLE,DOUBLE
)

set(GstQtVideoSink_SRCS
    utils/utils.cpp
    utils/bufferformat.cpp

    painters/genericsurfacepainter.cpp

    delegates/qtvideosinkdelegate.cpp
    delegates/qwidgetvideosinkdelegate.cpp

    gstqtvideosinkplugin.cpp
    gstqtvideosinkbase.cpp
    gstqtvideosink.cpp
    gstqwidgetvideosink.cpp

    ${CMAKE_CURRENT_BINARY_DIR}/gstqtvideosinkmarshal.c
)

if (Qt4or5_OpenGL_FOUND AND (OPENGL_FOUND OR OPENGLES2_FOUND))
    set(GstQtVideoSink_GL_SRCS
        painters/openglsurfacepainter.cpp
        gstqtglvideosinkbase.cpp
        gstqtglvideosink.cpp
    )
    set(GstQtVideoSink_test_GL_SRCS
        painters/openglsurfacepainter.cpp
    )

    if (OPENGLES2_FOUND)
        set(GstQtVideoSink_GL_LIBS ${OPENGLES2_LIBRARY})
        include_directories(${OPENGLES2_INCLUDE_DIR})
    else()
        set(GstQtVideoSink_GL_LIBS ${OPENGL_gl_LIBRARY})
        include_directories(${OPENGL_INCLUDE_DIR})
    endif()
else()
    add_definitions(-DGST_QT_VIDEO_SINK_NO_OPENGL)
endif()

add_definitions(
    -DQTVIDEOSINK_NAME="${QTVIDEOSINK_NAME}"
    -DQTGLVIDEOSINK_NAME="${QTGLVIDEOSINK_NAME}"
    -DQWIDGETVIDEOSINK_NAME="${QWIDGETVIDEOSINK_NAME}"
)

add_library(gst${QTVIDEOSINK_NAME} MODULE ${GstQtVideoSink_SRCS} ${GstQtVideoSink_GL_SRCS})
target_link_libraries(gst${QTVIDEOSINK_NAME}
    ${GOBJECT_LIBRARIES}
    ${GSTREAMER_LIBRARY}
    ${GSTREAMER_BASE_LIBRARY}
    ${GSTREAMER_VIDEO_LIBRARY}
    ${GSTREAMER_INTERFACES_LIBRARY}
    ${GstQtVideoSink_GL_LIBS}
)
qt4or5_use_modules(gst${QTVIDEOSINK_NAME} Core Gui Widgets)
if (Qt4or5_OpenGL_FOUND AND (OPENGL_FOUND OR OPENGLES2_FOUND))
    qt4or5_use_modules(gst${QTVIDEOSINK_NAME} OpenGL)
endif()
install(TARGETS gst${QTVIDEOSINK_NAME} DESTINATION ${QTGSTREAMER_GST_PLUGINS_INSTALL_DIR})

if (QTGSTREAMER_TESTS)
    add_executable(qtvideosink_autotest
        autotest.cpp
        utils/utils.cpp
        utils/bufferformat.cpp
        painters/genericsurfacepainter.cpp
        ${GstQtVideoSink_test_GL_SRCS}
    )
    target_link_libraries(qtvideosink_autotest
        ${GOBJECT_LIBRARIES}
        ${GSTREAMER_LIBRARY}
        ${GSTREAMER_BASE_LIBRARY}
        ${GSTREAMER_VIDEO_LIBRARY}
        ${GSTREAMER_INTERFACES_LIBRARY}
        ${GstQtVideoSink_GL_LIBS}
    )
    qt4or5_use_modules(qtvideosink_autotest Core Gui Widgets Test)
    if (Qt4or5_OpenGL_FOUND AND (OPENGL_FOUND OR OPENGLES2_FOUND))
        qt4or5_use_modules(qtvideosink_autotest OpenGL)
    endif()
endif()