2018-04-05 06:05:12 +00:00
|
|
|
sources = [
|
|
|
|
'gstplugin.cc',
|
2021-02-12 16:09:19 +00:00
|
|
|
'gstqtelement.cc',
|
2018-04-05 06:05:12 +00:00
|
|
|
'gstqsgtexture.cc',
|
|
|
|
'gstqtglutility.cc',
|
2020-02-26 07:29:06 +00:00
|
|
|
'gstqtoverlay.cc',
|
2018-04-05 06:05:12 +00:00
|
|
|
'gstqtsink.cc',
|
|
|
|
'gstqtsrc.cc',
|
2020-02-26 07:29:06 +00:00
|
|
|
'qtglrenderer.cc',
|
2018-04-05 06:05:12 +00:00
|
|
|
'qtitem.cc',
|
|
|
|
'qtwindow.cc',
|
|
|
|
]
|
|
|
|
|
|
|
|
moc_headers = [
|
|
|
|
'qtitem.h',
|
|
|
|
'qtwindow.h',
|
|
|
|
'gstqsgtexture.h',
|
2020-02-26 07:29:06 +00:00
|
|
|
'qtglrenderer.h',
|
2018-04-05 06:05:12 +00:00
|
|
|
]
|
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
# Define a not-found dependency so this variable is always defined when we're
|
|
|
|
# deciding whether to build the qt5 examples
|
|
|
|
qt5qml_dep = dependency('', required: false)
|
|
|
|
qt5_option = get_option('qt5')
|
2022-12-22 15:53:39 +00:00
|
|
|
qt5_method = get_option('qt-method')
|
2020-05-11 23:00:13 +00:00
|
|
|
|
|
|
|
if qt5_option.disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2020-05-11 23:02:01 +00:00
|
|
|
if not have_gstgl
|
2020-05-11 23:00:13 +00:00
|
|
|
if qt5_option.enabled()
|
|
|
|
error('qt5 qmlglsink plugin is enabled, but gstreamer-gl-1.0 was not found')
|
2019-04-01 12:50:28 +00:00
|
|
|
endif
|
2020-05-11 23:00:13 +00:00
|
|
|
subdir_done()
|
|
|
|
endif
|
2018-04-05 06:05:12 +00:00
|
|
|
|
2020-05-11 23:05:37 +00:00
|
|
|
if not add_languages('cpp', native: false, required: qt5_option)
|
2020-05-11 23:00:13 +00:00
|
|
|
subdir_done()
|
|
|
|
endif
|
2018-04-05 06:05:12 +00:00
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
qt5_mod = import('qt5')
|
|
|
|
qt5qml_dep = dependency('qt5', modules : ['Core', 'Gui', 'Qml', 'Quick'],
|
2022-12-22 15:53:39 +00:00
|
|
|
method: qt5_method, required: qt5_option, static: host_system == 'ios')
|
2018-04-05 06:05:12 +00:00
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
# On Linux, distros often have the Qt5 pkg-config files and moc in separate
|
|
|
|
# packages, so the user may not have both installed. Check for moc and ensure
|
|
|
|
# that it's installed.
|
|
|
|
# We don't do this check on other OSes because they need to be able to simply
|
|
|
|
# point the `QMAKE` env var to `qmake` to build against a particular Qt5.
|
2020-06-24 16:34:55 +00:00
|
|
|
if host_system == 'linux' and not meson.is_cross_build()
|
2020-05-11 23:00:13 +00:00
|
|
|
moc = find_program('moc-qt5', 'moc', required : qt5_option)
|
|
|
|
else
|
|
|
|
# We only check if `moc` was found, and then discard it, so we can fake it.
|
|
|
|
# This is also a good unit test of the fact that we *don't* use it.
|
|
|
|
moc = declare_dependency()
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not qt5qml_dep.found() or not moc.found()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
|
|
|
optional_deps = []
|
|
|
|
qt_defines = []
|
|
|
|
have_qpa_include = false
|
|
|
|
have_qt_windowing = false
|
|
|
|
|
2020-06-24 16:28:07 +00:00
|
|
|
# Look for the QPA platform native interface header
|
|
|
|
qpa_header_path = join_paths(qt5qml_dep.version(), 'QtGui')
|
|
|
|
qpa_header = join_paths(qpa_header_path, 'qpa/qplatformnativeinterface.h')
|
|
|
|
if cxx.has_header(qpa_header, dependencies : qt5qml_dep)
|
|
|
|
qt_defines += '-DHAVE_QT_QPA_HEADER'
|
|
|
|
qt_defines += '-DQT_QPA_HEADER=' + '<@0@>'.format(qpa_header)
|
|
|
|
have_qpa_include = true
|
|
|
|
message('Found QtGui QPA header in ' + qpa_header_path)
|
2020-05-11 23:00:13 +00:00
|
|
|
endif
|
2018-04-05 06:05:12 +00:00
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
# 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
|
|
|
|
# FIXME: automagic
|
2022-12-22 15:53:39 +00:00
|
|
|
qt5x11extras = dependency('qt5', modules : ['X11Extras'], method: qt5_method, required : false)
|
2020-05-11 23:00:13 +00:00
|
|
|
if qt5x11extras.found()
|
2020-07-24 06:58:34 +00:00
|
|
|
optional_deps += [qt5x11extras, gstglx11_dep]
|
2020-05-11 23:00:13 +00:00
|
|
|
qt_defines += ['-DHAVE_QT_X11']
|
|
|
|
have_qt_windowing = true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gst_gl_have_platform_egl
|
|
|
|
# Embedded linux (e.g. i.MX6) with or without windowing support
|
|
|
|
qt_defines += ['-DHAVE_QT_EGLFS']
|
2020-07-24 06:58:34 +00:00
|
|
|
optional_deps += gstglegl_dep
|
2020-05-11 23:00:13 +00:00
|
|
|
have_qt_windowing = true
|
|
|
|
if have_qpa_include
|
|
|
|
# Wayland windowing
|
|
|
|
if gst_gl_have_window_wayland
|
2018-07-25 02:05:28 +00:00
|
|
|
# FIXME: automagic
|
2022-12-22 15:53:39 +00:00
|
|
|
qt5waylandextras = dependency('qt5', modules : ['WaylandClient'], method: qt5_method, required : false)
|
2020-05-11 23:00:13 +00:00
|
|
|
if qt5waylandextras.found()
|
2020-07-24 06:58:34 +00:00
|
|
|
optional_deps += [qt5waylandextras, gstglwayland_dep]
|
2020-05-11 23:00:13 +00:00
|
|
|
qt_defines += ['-DHAVE_QT_WAYLAND']
|
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
|
2020-05-11 23:00:13 +00:00
|
|
|
# Android windowing
|
|
|
|
if gst_gl_have_window_android
|
|
|
|
# FIXME: automagic
|
2022-12-22 15:53:39 +00:00
|
|
|
qt5androidextras = dependency('qt5', modules : ['AndroidExtras'], method: qt5_method, required : false)
|
2020-05-11 23:00:13 +00:00
|
|
|
# for gl functions in QtGui/qopenglfunctions.h
|
2019-02-01 08:57:11 +00:00
|
|
|
# FIXME: automagic
|
2020-05-11 23:00:13 +00:00
|
|
|
glesv2_dep = cc.find_library('GLESv2', required : false)
|
|
|
|
if glesv2_dep.found() and qt5androidextras.found()
|
|
|
|
optional_deps += [qt5androidextras, glesv2_dep]
|
|
|
|
qt_defines += ['-DHAVE_QT_ANDROID']
|
2019-02-01 08:57:11 +00:00
|
|
|
have_qt_windowing = true
|
2020-05-11 23:00:13 +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)
|
2019-01-29 06:42:51 +00:00
|
|
|
endif
|
|
|
|
endif
|
2020-05-11 23:00:13 +00:00
|
|
|
endif
|
|
|
|
endif
|
2018-04-05 06:05:12 +00:00
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
if gst_gl_have_platform_wgl and gst_gl_have_window_win32
|
|
|
|
# for wglMakeCurrent()
|
|
|
|
# FIXME: automagic
|
|
|
|
opengl32_dep = cc.find_library('opengl32', required : false)
|
|
|
|
if opengl32_dep.found()
|
|
|
|
qt_defines += ['-DHAVE_QT_WIN32']
|
|
|
|
optional_deps += opengl32_dep
|
|
|
|
have_qt_windowing = true
|
|
|
|
endif
|
|
|
|
endif
|
2019-02-01 08:57:11 +00:00
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
if gst_gl_have_window_cocoa and gst_gl_have_platform_cgl
|
|
|
|
# FIXME: automagic
|
2022-12-22 15:53:39 +00:00
|
|
|
qt5macextras = dependency('qt5', modules : ['MacExtras'], method: qt5_method, required : false)
|
2020-05-11 23:00:13 +00:00
|
|
|
if qt5macextras.found()
|
|
|
|
qt_defines += ['-DHAVE_QT_MAC']
|
|
|
|
optional_deps += qt5macextras
|
|
|
|
have_qt_windowing = true
|
2018-04-05 06:05:12 +00:00
|
|
|
endif
|
|
|
|
endif
|
2020-05-11 23:00:13 +00:00
|
|
|
|
|
|
|
if gst_gl_have_window_eagl and gst_gl_have_platform_eagl
|
|
|
|
if host_machine.system() == 'ios'
|
|
|
|
qt_defines += ['-DHAVE_QT_IOS']
|
|
|
|
have_qt_windowing = true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if have_qt_windowing
|
2023-01-10 19:41:06 +00:00
|
|
|
# rpath is needed to be able to load the plugin on macOS inside the devenv
|
|
|
|
qmlgl_kwargs = {}
|
|
|
|
if host_system == 'darwin'
|
|
|
|
fs = import('fs')
|
|
|
|
qt_bindir = fs.parent(find_program('qmake').full_path())
|
|
|
|
qt_libdir = fs.parent(qt_bindir) / 'lib'
|
|
|
|
qmlgl_kwargs += {'build_rpath': qt_libdir}
|
|
|
|
endif
|
|
|
|
|
2020-05-11 23:00:13 +00:00
|
|
|
# Build it!
|
|
|
|
moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
|
|
|
|
gstqmlgl = library('gstqmlgl', sources, moc_files,
|
|
|
|
cpp_args : gst_plugins_good_args + qt_defines,
|
|
|
|
link_args : noseh_link_args,
|
|
|
|
include_directories: [configinc, libsinc],
|
2022-03-25 19:00:20 +00:00
|
|
|
dependencies : [gst_dep, gstvideo_dep, gstgl_dep, gstglproto_dep, qt5qml_dep, optional_deps],
|
2020-05-11 23:00:13 +00:00
|
|
|
override_options : ['cpp_std=c++11'],
|
2023-01-10 19:41:06 +00:00
|
|
|
kwargs: qmlgl_kwargs,
|
2020-05-11 23:00:13 +00:00
|
|
|
install: true,
|
|
|
|
install_dir : plugins_install_dir)
|
|
|
|
plugins += [gstqmlgl]
|
|
|
|
endif
|