2018-04-05 06:05:12 +00:00
|
|
|
sources = [
|
|
|
|
'gstplugin.cc',
|
|
|
|
'gstqsgtexture.cc',
|
|
|
|
'gstqtglutility.cc',
|
|
|
|
'gstqtsink.cc',
|
|
|
|
'gstqtsrc.cc',
|
|
|
|
'qtitem.cc',
|
|
|
|
'qtwindow.cc',
|
|
|
|
]
|
|
|
|
|
|
|
|
moc_headers = [
|
|
|
|
'qtitem.h',
|
|
|
|
'qtwindow.h',
|
|
|
|
'gstqsgtexture.h',
|
|
|
|
]
|
|
|
|
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: -Dqt5=enabled is silently ignored if a c++ compiler is not found
|
2018-04-05 06:05:12 +00:00
|
|
|
if have_cxx and build_gstgl
|
|
|
|
qt5_mod = import('qt5')
|
2018-07-25 02:05:28 +00:00
|
|
|
qt5qml_dep = dependency('qt5', modules : ['Core', 'Gui', 'Qml', 'Quick'],
|
|
|
|
required: get_option('qt5'))
|
2018-04-05 06:05:12 +00:00
|
|
|
|
|
|
|
# FIXME Add a way to get that information out of the qt5 module
|
2018-07-25 02:05:28 +00:00
|
|
|
moc = find_program('moc-qt5', 'moc', required : get_option('qt5'))
|
2018-04-05 06:05:12 +00:00
|
|
|
if qt5qml_dep.found() and moc.found()
|
|
|
|
optional_deps = []
|
|
|
|
qt_defines = []
|
|
|
|
have_qpa_include = false
|
|
|
|
have_qt_windowing = false
|
|
|
|
|
|
|
|
# Attempt to find the QPA header either through pkg-config (preferred) or qmake
|
|
|
|
# This semi-matches what meson does internally with the qt5 module
|
|
|
|
# FIXME Add a way to get some of this information out of the qt5 module
|
|
|
|
if not have_qpa_include
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: automagic
|
2018-04-05 06:05:12 +00:00
|
|
|
qt5core_dep = dependency('Qt5Core', required: false)
|
|
|
|
if qt5core_dep.found() and qt5core_dep.type_name() == 'pkgconfig'
|
|
|
|
qt_version = qt5core_dep.version()
|
|
|
|
qt_include_dir = qt5core_dep.get_pkgconfig_variable('includedir')
|
|
|
|
qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
|
|
|
|
if cxx.has_header('qpa/qplatformnativeinterface.h',
|
|
|
|
dependencies : qt5core_dep,
|
|
|
|
args : '-I' + qpa_include_path)
|
|
|
|
qt_defines += '-DHAVE_QT_QPA_HEADER'
|
|
|
|
qt_defines += '-I' + qpa_include_path
|
|
|
|
have_qpa_include = true
|
|
|
|
message('Found QPA header using pkg-config')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
if not have_qpa_include
|
2019-01-18 09:11:14 +00:00
|
|
|
qmake = find_program('qmake-qt5', 'qmake')
|
2018-04-05 06:05:12 +00:00
|
|
|
if qmake.found()
|
|
|
|
qt_version = run_command(qmake, '-query', 'QT_VERSION').stdout().strip()
|
|
|
|
qt_include_dir = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip()
|
|
|
|
qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
|
|
|
|
if cxx.has_header('qpa/qplatformnativeinterface.h',
|
|
|
|
args : '-I' + qpa_include_path)
|
|
|
|
qt_defines += '-DHAVE_QT_QPA_HEADER'
|
|
|
|
qt_defines += '-I' + qpa_include_path
|
|
|
|
have_qpa_include = true
|
|
|
|
message('Found QPA header using qmake')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Try to come up with all the platform/winsys combinations that will work
|
|
|
|
|
|
|
|
if gst_gl_have_window_x11 and gst_gl_have_platform_glx
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: automagic
|
2018-04-05 06:05:12 +00:00
|
|
|
qt5x11extras = dependency('qt5', modules : ['X11Extras'], required : false)
|
|
|
|
if qt5x11extras.found()
|
|
|
|
optional_deps += qt5x11extras
|
|
|
|
qt_defines += ['-DHAVE_QT_X11']
|
|
|
|
have_qt_windowing = true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gst_gl_have_platform_egl
|
2019-01-29 06:42:51 +00:00
|
|
|
# Embedded linux (e.g. i.MX6) with or without windowing support
|
|
|
|
qt_defines += ['-DHAVE_QT_EGLFS']
|
|
|
|
have_qt_windowing = true
|
2018-04-05 06:05:12 +00:00
|
|
|
if have_qpa_include
|
2019-01-29 06:42:51 +00:00
|
|
|
# Wayland windowing
|
2018-04-05 06:05:12 +00:00
|
|
|
if gst_gl_have_window_wayland
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: automagic
|
2018-04-05 06:05:12 +00:00
|
|
|
qt5waylandextras = dependency('qt5', modules : ['WaylandClient'], required : false)
|
|
|
|
if qt5waylandextras.found()
|
|
|
|
optional_deps += qt5waylandextras
|
|
|
|
qt_defines += ['-DHAVE_QT_WAYLAND']
|
|
|
|
have_qt_windowing = true
|
|
|
|
endif
|
|
|
|
endif
|
2019-01-29 06:42:51 +00:00
|
|
|
# Android windowing
|
2018-04-05 06:05:12 +00:00
|
|
|
if gst_gl_have_window_android
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: automagic
|
2018-04-05 06:05:12 +00:00
|
|
|
qt5androidextras = dependency('qt5', modules : ['AndroidExtras'], required : false)
|
2019-01-29 06:42:51 +00:00
|
|
|
# for gl functions in QtGui/qopenglfunctions.h
|
|
|
|
# FIXME: automagic
|
|
|
|
glesv2_dep = cc.find_library('GLESv2', required : false)
|
|
|
|
if glesv2_dep.found() and qt5androidextras.found()
|
|
|
|
optional_deps += [qt5androidextras, glesv2_dep]
|
2019-01-19 14:46:41 +00:00
|
|
|
qt_defines += ['-DHAVE_QT_ANDROID']
|
2018-04-05 06:05:12 +00:00
|
|
|
have_qt_windowing = true
|
2019-01-29 06:42:51 +00:00
|
|
|
# Needed for C++11 support in Cerbero. People building with Android
|
|
|
|
# in some other way need to add the necessary bits themselves.
|
|
|
|
optional_deps += dependency('gnustl', required : false)
|
2018-04-05 06:05:12 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gst_gl_have_platform_wgl and gst_gl_have_window_win32
|
2018-06-07 03:56:03 +00:00
|
|
|
# for wglMakeCurrent()
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: automagic
|
2018-04-05 06:05:12 +00:00
|
|
|
opengl32_dep = cc.find_library('opengl32', required : false)
|
|
|
|
if opengl32_dep.found()
|
|
|
|
qt_defines += ['-DHAVE_QT_WIN32']
|
2018-06-07 03:56:03 +00:00
|
|
|
optional_deps += opengl32_dep
|
2018-04-05 06:05:12 +00:00
|
|
|
have_qt_windowing = true
|
2018-06-07 03:56:03 +00:00
|
|
|
endif
|
2018-04-05 06:05:12 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# FIXME: OSX/iOS definitions
|
|
|
|
|
|
|
|
if have_qt_windowing
|
|
|
|
# Build it!
|
|
|
|
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
2019-01-18 21:09:32 +00:00
|
|
|
gstqmlgl = library('gstqmlgl', sources, moc_files,
|
2018-04-05 06:05:12 +00:00
|
|
|
cpp_args : gst_plugins_good_args + qt_defines,
|
|
|
|
link_args : noseh_link_args,
|
|
|
|
include_directories: [configinc, libsinc],
|
|
|
|
dependencies : [glib_deps, gst_dep, gstvideo_dep, gstgl_dep, qt5qml_dep, optional_deps],
|
|
|
|
install: true,
|
|
|
|
install_dir : plugins_install_dir)
|
2019-01-18 21:09:32 +00:00
|
|
|
pkgconfig.generate(gstqmlgl, install_dir : plugins_pkgconfig_install_dir)
|
2018-04-05 06:05:12 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|