Send seek event to baseparse when aacparse seek failed in push mode
[platform/upstream/gst-plugins-good.git] / ext / qt / meson.build
1 sources = [
2   'gstplugin.cc',
3   'gstqsgtexture.cc',
4   'gstqtglutility.cc',
5   'gstqtsink.cc',
6   'gstqtsrc.cc',
7   'qtitem.cc',
8   'qtwindow.cc',
9 ]
10
11 moc_headers = [
12   'qtitem.h',
13   'qtwindow.h',
14   'gstqsgtexture.h',
15 ]
16
17 # FIXME: -Dqt5=enabled is silently ignored if a c++ compiler is not found
18 if have_cxx and build_gstgl
19   qt5_mod = import('qt5')
20   qt5qml_dep = dependency('qt5', modules : ['Core', 'Gui', 'Qml', 'Quick'],
21                           required: get_option('qt5'), static: host_machine.system() == 'ios')
22
23   # On Linux, distros often have the Qt5 pkg-config files and moc in separate
24   # packages, so the user may not have both installed. Check for moc and ensure
25   # that it's installed.
26   # We don't do this check on other OSes because they need to be able to simply
27   # point the `QMAKE` env var to `qmake` to build against a particular Qt5.
28   if host_system == 'linux'
29     moc = find_program('moc-qt5', 'moc', required : get_option('qt5'))
30   else
31     # We only check if `moc` was found, and then discard it, so we can fake it.
32     # This is also a good unit test of the fact that we *don't* use it.
33     moc = declare_dependency()
34   endif
35   if qt5qml_dep.found() and moc.found()
36     optional_deps = []
37     qt_defines = []
38     have_qpa_include = false
39     have_qt_windowing = false
40
41     # Attempt to find the QPA header either through pkg-config (preferred) or qmake
42     # This semi-matches what meson does internally with the qt5 module
43     # FIXME Add a way to get some of this information out of the qt5 module
44     if not have_qpa_include
45       # FIXME: automagic
46       qt5core_dep = dependency('Qt5Core', required: false)
47       if qt5core_dep.found() and qt5core_dep.type_name() == 'pkgconfig'
48         qt_version = qt5core_dep.version()
49         qt_include_dir = qt5core_dep.get_pkgconfig_variable('includedir')
50         qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
51         if cxx.has_header('qpa/qplatformnativeinterface.h',
52                 dependencies : qt5core_dep,
53                 args : '-I' + qpa_include_path)
54           qt_defines += '-DHAVE_QT_QPA_HEADER'
55           qt_defines += '-I' + qpa_include_path
56           have_qpa_include = true
57           message('Found QPA header using pkg-config')
58         endif
59       endif
60     endif
61     if not have_qpa_include
62       qmake = find_program('qmake-qt5', 'qmake')
63       if qmake.found()
64         qt_version = run_command(qmake, '-query', 'QT_VERSION').stdout().strip()
65         qt_include_dir = run_command(qmake, '-query', 'QT_INSTALL_HEADERS').stdout().strip()
66         qpa_include_path = join_paths(qt_include_dir, 'QtGui', qt_version, 'QtGui')
67         if cxx.has_header('qpa/qplatformnativeinterface.h',
68                 args : '-I' + qpa_include_path)
69           qt_defines += '-DHAVE_QT_QPA_HEADER'
70           qt_defines += '-I' + qpa_include_path
71           have_qpa_include = true
72           message('Found QPA header using qmake')
73         endif
74       endif
75     endif
76
77     # Try to come up with all the platform/winsys combinations that will work
78
79     if gst_gl_have_window_x11 and gst_gl_have_platform_glx
80       # FIXME: automagic
81       qt5x11extras = dependency('qt5', modules : ['X11Extras'], required : false)
82       if qt5x11extras.found()
83         optional_deps += qt5x11extras
84         qt_defines += ['-DHAVE_QT_X11']
85         have_qt_windowing = true
86       endif
87     endif
88
89     if gst_gl_have_platform_egl
90       # Embedded linux (e.g. i.MX6) with or without windowing support
91       qt_defines += ['-DHAVE_QT_EGLFS']
92       have_qt_windowing = true
93       if have_qpa_include
94         # Wayland windowing
95         if gst_gl_have_window_wayland
96           # FIXME: automagic
97           qt5waylandextras = dependency('qt5', modules : ['WaylandClient'], required : false)
98           if qt5waylandextras.found()
99             optional_deps += qt5waylandextras
100             qt_defines += ['-DHAVE_QT_WAYLAND']
101             have_qt_windowing = true
102           endif
103         endif
104         # Android windowing
105         if gst_gl_have_window_android
106           # FIXME: automagic
107           qt5androidextras = dependency('qt5', modules : ['AndroidExtras'], required : false)
108           # for gl functions in QtGui/qopenglfunctions.h
109           # FIXME: automagic
110           glesv2_dep = cc.find_library('GLESv2', required : false)
111           if glesv2_dep.found() and qt5androidextras.found()
112             optional_deps += [qt5androidextras, glesv2_dep]
113             qt_defines += ['-DHAVE_QT_ANDROID']
114             have_qt_windowing = true
115             # Needed for C++11 support in Cerbero. People building with Android
116             # in some other way need to add the necessary bits themselves.
117             optional_deps += dependency('gnustl', required : false)
118           endif
119         endif
120       endif
121     endif
122
123     if gst_gl_have_platform_wgl and gst_gl_have_window_win32
124       # for wglMakeCurrent()
125       # FIXME: automagic
126       opengl32_dep = cc.find_library('opengl32', required : false)
127       if opengl32_dep.found()
128         qt_defines += ['-DHAVE_QT_WIN32']
129         optional_deps += opengl32_dep
130         have_qt_windowing = true
131       endif
132     endif
133
134     if gst_gl_have_window_cocoa and gst_gl_have_platform_cgl
135       # FIXME: automagic
136       qt5macextras = dependency('qt5', modules : ['MacExtras'], required : false)
137       if qt5macextras.found()
138         qt_defines += ['-DHAVE_QT_MAC']
139         optional_deps += qt5macextras
140         have_qt_windowing = true
141       endif
142     endif
143
144     if gst_gl_have_window_eagl and gst_gl_have_platform_eagl
145       if host_machine.system() == 'ios'
146         qt_defines += ['-DHAVE_QT_IOS']
147         have_qt_windowing = true
148       endif
149     endif
150
151     if have_qt_windowing
152       # Build it!
153       moc_files = qt5_mod.preprocess(moc_headers : moc_headers)
154       gstqmlgl = library('gstqmlgl', sources, moc_files,
155         cpp_args : gst_plugins_good_args + qt_defines,
156         link_args : noseh_link_args,
157         include_directories: [configinc, libsinc],
158         dependencies : [glib_deps, gst_dep, gstvideo_dep, gstgl_dep, qt5qml_dep, optional_deps],
159         override_options : ['cpp_std=c++11'],
160         install: true,
161         install_dir : plugins_install_dir)
162       pkgconfig.generate(gstqmlgl, install_dir : plugins_pkgconfig_install_dir)
163     endif
164   endif
165 endif