bfaaf1d380e918305337fecc8568107355c6698c
[platform/upstream/gst-plugins-base.git] / gst-libs / gst / gl / meson.build
1 if get_option('gl').disabled()
2   message('GStreamer OpenGL integration disabled via options.')
3   gstgl_dep = dependency('', required: false)
4   build_gstgl = false
5   subdir_done()
6 endif
7
8 gl_sources = [
9   'gstglapi.c',
10   'gstglbasefilter.c',
11   'gstglbasememory.c',
12   'gstglbasesrc.c',
13   'gstglcolorconvert.c',
14   'gstglbuffer.c',
15   'gstglbufferpool.c',
16   'gstglcontext.c',
17   'gstglcontextconfig.c',
18   'gstgldebug.c',
19   'gstgldisplay.c',
20   'gstglfeature.c',
21   'gstglfilter.c',
22   'gstglformat.c',
23   'gstglframebuffer.c',
24   'gstglmemory.c',
25   'gstglmemorypbo.c',
26   'gstgloverlaycompositor.c',
27   'gstglquery.c',
28   'gstglrenderbuffer.c',
29   'gstglshader.c',
30   'gstglshaderstrings.c',
31   'gstglsl.c',
32   'gstglslstage.c',
33   'gstglsyncmeta.c',
34   'gstglupload.c',
35   'gstglutils.c',
36   'gstglviewconvert.c',
37   'gstglwindow.c',
38 ]
39
40 gl_priv_sources = []
41
42 gir_gl_headers = [
43   'gl.h',
44   'gl-prelude.h',
45   'gstgl_enums.h',
46   'gstgl_fwd.h',
47   'gstglapi.h',
48   'gstglbasefilter.h',
49   'gstglbasememory.h',
50   'gstglbasesrc.h',
51   'gstglbuffer.h',
52   'gstglbufferpool.h',
53   'gstglcolorconvert.h',
54   'gstglcontext.h',
55   'gstglcontextconfig.h',
56   'gstgldebug.h',
57   'gstgldisplay.h',
58   'gstglfeature.h',
59   'gstglfilter.h',
60   'gstglformat.h',
61   'gstglframebuffer.h',
62   'gstglmemory.h',
63   'gstglmemorypbo.h',
64   'gstgloverlaycompositor.h',
65   'gstglquery.h',
66   'gstglrenderbuffer.h',
67   'gstglshader.h',
68   'gstglshaderstrings.h',
69   'gstglsl.h',
70   'gstglslstage.h',
71   'gstglsyncmeta.h',
72   'gstglupload.h',
73   'gstglutils.h',
74   'gstglviewconvert.h',
75   'gstglwindow.h',
76 ]
77
78 gl_headers = gir_gl_headers + [
79   'gstglfuncs.h',
80 ]
81
82 gl_prototype_headers = [
83   'glprototypes/all_functions.h',
84   'glprototypes/base.h',
85   'glprototypes/blending.h',
86   'glprototypes/buffers.h',
87   'glprototypes/debug.h',
88   'glprototypes/eglimage.h',
89   'glprototypes/fbo.h',
90   'glprototypes/fixedfunction.h',
91   'glprototypes/gles.h',
92   'glprototypes/gstgl_compat.h',
93   'glprototypes/gstgl_gles2compat.h',
94   'glprototypes/opengl.h',
95   'glprototypes/query.h',
96   'glprototypes/shaders.h',
97   'glprototypes/sync.h',
98   'glprototypes/vao.h',
99 ]
100
101 gl_x11_sources = []
102 gl_x11_headers = []
103 gl_wayland_sources = []
104 gl_wayland_headers = []
105 gl_egl_sources = []
106 gl_egl_headers = []
107
108 glconf = configuration_data()
109 glconf_options = [
110     'GST_GL_HAVE_OPENGL',
111     'GST_GL_HAVE_GLES2',
112     'GST_GL_HAVE_GLES3',
113     'GST_GL_HAVE_GLES3EXT3_H',
114
115     'GST_GL_HAVE_WINDOW_X11',
116     'GST_GL_HAVE_WINDOW_COCOA',
117     'GST_GL_HAVE_WINDOW_WIN32',
118     'GST_GL_HAVE_WINDOW_WINRT',
119     'GST_GL_HAVE_WINDOW_WAYLAND',
120     'GST_GL_HAVE_WINDOW_ANDROID',
121     'GST_GL_HAVE_WINDOW_DISPMANX',
122     'GST_GL_HAVE_WINDOW_EAGL',
123     'GST_GL_HAVE_WINDOW_VIV_FB',
124     'GST_GL_HAVE_WINDOW_GBM',
125
126     'GST_GL_HAVE_PLATFORM_EGL',
127     'GST_GL_HAVE_PLATFORM_GLX',
128     'GST_GL_HAVE_PLATFORM_WGL',
129     'GST_GL_HAVE_PLATFORM_CGL',
130     'GST_GL_HAVE_PLATFORM_EAGL',
131
132     'GST_GL_HAVE_DMABUF',
133     'GST_GL_HAVE_VIV_DIRECTVIV',
134
135     'GST_GL_HAVE_GLEGLIMAGEOES',
136     'GST_GL_HAVE_GLCHAR',
137     'GST_GL_HAVE_GLSIZEIPTR',
138     'GST_GL_HAVE_GLINTPTR',
139     'GST_GL_HAVE_GLSYNC',
140     'GST_GL_HAVE_GLUINT64',
141     'GST_GL_HAVE_GLINT64',
142     'GST_GL_HAVE_EGLATTRIB',
143     'GST_GL_HAVE_EGLUINT64KHR',
144 ]
145
146 foreach option : glconf_options
147   glconf.set10(option, false)
148 endforeach
149
150 unneeded_dep = dependency('', required : false)
151 if unneeded_dep.found()
152   error ('Found unfindable dependency')
153 endif
154
155 # OpenGL/GLES2 libraries
156 gl_lib_deps = []
157 # GL platform - EGL, GLX, CGL, WGL, etc
158 gl_platform_deps = []
159 # GL winsys - wayland, X11, Cocoa, win32, etc
160 gl_winsys_deps = []
161 # other things we need.
162 gl_misc_deps = []
163 # Other preprocessor arguments
164 gl_cpp_args = []
165 gl_includes = []
166 gl_objc_args = []
167
168 enabled_gl_apis = []
169 enabled_gl_platforms = []
170 enabled_gl_winsys = []
171
172 # parse provided options
173 libegl_module_name = get_option('egl_module_name')
174 if libegl_module_name != ''
175   gl_cpp_args += ['-DGST_GL_LIBEGL_MODULE_NAME="@0@"'.format(libegl_module_name)]
176 endif
177 libgles2_module_name = get_option('gles2_module_name')
178 if libgles2_module_name != ''
179   gl_cpp_args += ['-DGST_GL_LIBGLESV2_MODULE_NAME="@0@"'.format(libgles2_module_name)]
180 endif
181 libgl_module_name = get_option('opengl_module_name')
182 if libgl_module_name != ''
183   gl_cpp_args += ['-DGST_GL_LIBGL_MODULE_NAME="@0@"'.format(libgl_module_name)]
184 endif
185
186 gl_apis = get_option('gl_api')
187 if gl_apis.contains('auto')
188   need_api_opengl = 'auto'
189   need_api_gles2 = 'auto'
190 else
191   need_api_opengl = 'no'
192   need_api_gles2 = 'no'
193   foreach api : gl_apis
194     if api == 'opengl'
195       need_api_opengl = 'yes'
196     elif api == 'gles2'
197       need_api_gles2 = 'yes'
198     else
199       error('Unsupported GL api provided ' + api)
200     endif
201   endforeach
202 endif
203
204 gl_platforms = get_option('gl_platform')
205 if gl_platforms.contains('auto')
206   need_platform_egl = 'auto'
207   need_platform_glx = 'auto'
208   need_platform_cgl = 'auto'
209   need_platform_wgl = 'auto'
210   need_platform_eagl = 'auto'
211 else
212   need_platform_egl = 'no'
213   need_platform_glx = 'no'
214   need_platform_cgl = 'no'
215   need_platform_wgl = 'no'
216   need_platform_eagl = 'no'
217   foreach platform : gl_platforms
218     if platform == 'egl'
219       need_platform_egl = 'yes'
220     elif platform == 'glx'
221       need_platform_glx = 'yes'
222     elif platform == 'cgl'
223       need_platform_cgl = 'yes'
224     elif platform == 'wgl'
225       need_platform_wgl = 'yes'
226     elif platform == 'eagl'
227       need_platform_eagl = 'yes'
228     else
229       error('Unsupported GL platform provided ' + platform)
230     endif
231   endforeach
232 endif
233
234 gl_winsys = get_option('gl_winsys')
235 if gl_winsys.contains('auto')
236   need_win_x11 = 'auto'
237   need_win_wayland = 'auto'
238   need_win_win32 = 'auto'
239   need_win_winrt = 'auto'
240   need_win_cocoa = 'auto'
241   need_win_egl = 'auto'
242   need_win_eagl = 'auto'
243   need_win_dispmanx = 'auto'
244   need_win_viv_fb = 'auto'
245   need_win_gbm = 'auto'
246   need_win_android = 'auto'
247 else
248   need_win_x11 = 'no'
249   need_win_wayland = 'no'
250   need_win_win32 = 'no'
251   need_win_winrt = 'no'
252   need_win_cocoa = 'no'
253   need_win_egl = 'no'
254   need_win_eagl = 'no'
255   need_win_dispmanx = 'no'
256   need_win_viv_fb = 'no'
257   need_win_gbm = 'no'
258   need_win_android = 'no'
259   foreach winsys : gl_winsys
260     if winsys == 'x11'
261       need_win_x11 = 'yes'
262     elif winsys == 'wayland'
263       need_win_wayland = 'yes'
264     elif winsys == 'win32'
265       need_win_win32 = 'yes'
266     elif winsys == 'winrt'
267       need_win_winrt = 'yes'
268     elif winsys == 'cocoa'
269       need_win_cocoa = 'yes'
270     elif winsys == 'egl'
271       need_win_egl = 'yes'
272     elif winsys == 'eagl'
273       need_win_eagl = 'yes'
274     elif winsys == 'dispmanx'
275       need_win_dispmanx = 'yes'
276     elif winsys == 'viv-fb'
277       need_win_viv_fb = 'yes'
278     elif winsys == 'gbm'
279       need_win_gbm = 'yes'
280     elif winsys == 'android'
281       need_win_android = 'yes'
282     else
283       error('Unsupported GL winsys provided ' + winsys)
284     endif
285   endforeach
286 endif
287
288 gl_include_header = '''
289 #ifdef __GNUC__
290 #  pragma GCC diagnostic push
291 #  pragma GCC diagnostic ignored "-Wredundant-decls"
292 #endif
293 #ifndef GL_GLEXT_PROTOTYPES
294 #define GL_GLEXT_PROTOTYPES 1
295 #endif
296 '''
297
298 # convoluted way of getting at the subproject taking into account the wrap-mode
299 # so we don't download a subproject unless allowed
300 gl_header_dep = dependency('', fallback : ['gl-headers', 'gl_headers_dummy_dep'],
301     required : false)
302 if gl_header_dep.type_name() == 'internal'
303   # this will only contain the includes of headers that are not found
304   compat_includes = subproject('gl-headers').get_variable('compatibility_includes')
305 else
306   compat_includes = []
307 endif
308
309 # Desktop OpenGL checks
310 gl_dep = unneeded_dep
311 glx_dep = unneeded_dep
312
313 # (GLVND) OpenGL (without GLX) headers and interface
314 if need_api_opengl != 'no'
315   gl_dep = dependency('opengl', method: 'pkg-config', required : false)
316 endif
317
318 # non-GLVND aka Legacy OpenGL
319 if need_api_opengl != 'no' and not gl_dep.found()
320   if host_system == 'darwin'
321     gl_dep = dependency('appleframeworks', modules : ['OpenGL'], required : false)
322   else
323     # override meson's braindead gl detection on osx/windows/etc by forcing pkg-config
324     gl_dep = dependency('gl', method: 'pkg-config', required : false)
325   endif
326
327   if not gl_dep.found()
328     if host_system == 'windows'
329       gl_dep = cc.find_library('opengl32', required : false)
330     else
331       gl_dep = cc.find_library('GL', required : false)
332     endif
333
334     if not cc.has_header('GL/gl.h', include_directories : compat_includes)
335       gl_dep = unneeded_dep
336     endif
337
338     if not gl_dep.found() and need_api_opengl == 'yes'
339       error ('Could not find requested OpenGL library')
340     endif
341
342     if gl_dep.found()
343       gl_includes += [compat_includes]
344     endif
345   endif
346 endif
347
348 if need_platform_glx != 'no'
349   # (GLVND) GLX library and headers.
350   glx_dep = dependency('glx', method: 'pkg-config', required : false)
351
352   if not glx_dep.found()
353     if host_system == 'darwin'
354       glx_dep = cc.find_library('GL', required : false)
355     elif gl_dep.found()
356       glx_dep = gl_dep
357     elif need_platform_glx == 'yes'
358       error ('Could not find requested GLX library')
359     endif
360   endif
361 endif
362
363 if need_api_opengl != 'no'
364   opengl_includes = ''
365   if host_system == 'darwin'
366     opengl_includes += '''
367 #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
368 # define GL_SILENCE_DEPRECATION
369 #endif
370 #include <OpenGL/OpenGL.h>
371 #include <OpenGL/gl.h>
372 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
373 # define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
374 # include <OpenGL/gl3.h>
375 #endif
376 '''
377   else
378     opengl_includes += '''
379 #if _MSC_VER
380 # include <windows.h>
381 #endif
382 #include <GL/gl.h>
383 #if __WIN32__ || _WIN32
384 # include <GL/glext.h>
385 #endif
386 '''
387   endif
388 endif
389
390 bcm_host_dep = unneeded_dep
391 if need_win_dispmanx != 'no'
392
393   # Try pkg-config for bcm_host then fallback to find_library to also
394   # support older distribution
395   bcm_host_dep = dependency('bcm_host', required : false)
396   if not bcm_host_dep.found()
397     bcm_host_dep = cc.find_library('bcm_host', required : false)
398   endif
399 endif
400
401 # GLES2 checks
402 gles2_dep = unneeded_dep
403 gles3_h = false
404 gles3ext3_h = false
405 if need_api_gles2 != 'no'
406   if host_system == 'ios'
407     gles2_dep = dependency('appleframeworks', modules : ['OpenGLES'], required : false)
408   else
409     if bcm_host_dep.found()
410       gles2_dep = dependency('brcmglesv2', required : false)
411     endif
412     if not gles2_dep.found()
413       gles2_dep = dependency('glesv2', required : false)
414     endif
415   endif
416
417   if not gles2_dep.found()
418 #    if host_system == 'windows'
419 #    elif host_system == ios
420 #      gles2_dep = cc.find_library('GLESv2', required : false)
421 #    else
422       gles2_dep = cc.find_library('GLESv2', required : false)
423 #    endif
424
425     if not cc.has_header('GLES2/gl2.h', include_directories : compat_includes)
426       gles2_dep = unneeded_dep
427     endif
428
429     if not gles2_dep.found() and need_api_gles2 == 'yes'
430       error ('Could not find requested OpenGL ES library')
431     endif
432
433     if gles2_dep.found()
434       gl_includes += [compat_includes]
435     endif
436   endif
437
438   gles3_h = gles2_dep.found() and cc.has_header('GLES3/gl3.h', dependencies : gles2_dep, include_directories : compat_includes)
439
440   gles_includes = ''
441   if host_system == 'ios'
442     gles_includes += '''
443 # include <OpenGLES/ES2/gl.h>
444 # include <OpenGLES/ES2/glext.h>
445 '''
446   else
447     if gles3_h
448       gl_includes += [compat_includes]
449       gles3ext3_h = gles3_h and cc.has_header('GLES3/gl3ext.h', dependencies : gles2_dep, include_directories : compat_includes)
450       gles_includes += '''
451 # include <GLES3/gl3.h>
452 # include <GLES2/gl2ext.h>'''
453       if gles3ext3_h
454         gles_includes += '''
455 # include <GLES3/gl3ext.h>'''
456       endif
457     else
458       gles_includes += '''
459 # include <GLES2/gl2.h>
460 # include <GLES2/gl2ext.h>'''
461     endif
462   endif
463 endif
464
465 # can we include both gles2 and opengl headers?
466 if gles2_dep.found() and gl_dep.found()
467   gl_include_block = gl_include_header + gles_includes + opengl_includes
468   # TODO: Revert to passing gl_include_block via prefix: once
469   # https://github.com/mesonbuild/meson/issues/2364 is fixed
470   if not cc.compiles(gl_include_block + '\n' + 'void f (void) {}',dependencies : [gles2_dep, gl_dep], include_directories : compat_includes)
471     message ('Cannot include both OpenGL and OpenGL ES headers')
472     if need_api_gles2 != 'yes'
473       gles2_dep = unneeded_dep
474     elif need_api_opengl != 'yes'
475       gl_dep = unneeded_dep
476     else
477       error('Both OpenGL and OpenGL ES were requested but cannot be included together')
478     endif
479   endif
480 endif
481 gl_include_block = gl_include_header
482 if gles2_dep.found()
483   gl_include_block += gles_includes
484 endif
485 if gl_dep.found()
486   gl_include_block += opengl_includes
487 endif
488
489 if gles2_dep.found()
490   gl_lib_deps += gles2_dep
491   glconf.set10('GST_GL_HAVE_GLES2', 1)
492   if gles3_h
493     glconf.set10('GST_GL_HAVE_GLES3', 1)
494     if gles3ext3_h
495       glconf.set10('GST_GL_HAVE_GLES3EXT3_H', 1)
496     endif
497   endif
498   enabled_gl_apis += 'gles2'
499 endif
500
501 if gl_dep.found()
502   gl_lib_deps += gl_dep
503   glconf.set10('GST_GL_HAVE_OPENGL', 1)
504   enabled_gl_apis += 'gl'
505 endif
506
507 # EGL checks
508 egl_dep = unneeded_dep
509 if need_platform_egl != 'no'
510   if bcm_host_dep.found()
511     egl_dep = dependency('brcmegl', required : false)
512   endif
513   if not egl_dep.found()
514     egl_dep = dependency('egl', required : false)
515   endif
516   if not egl_dep.found()
517     egl_dep = cc.find_library('EGL', required : false)
518   endif
519
520   if egl_dep.found() and not cc.has_header('EGL/egl.h',
521                                            dependencies : egl_dep,
522                                            include_directories : compat_includes)
523     egl_dep = unneeded_dep
524   endif
525   if egl_dep.found() and not cc.has_header('EGL/eglext.h',
526                                            dependencies : egl_dep,
527                                            include_directories : compat_includes)
528     egl_dep = unneeded_dep
529   endif
530
531   if egl_dep.found()
532     gl_egl_sources += [
533       'egl/gstegl.c',
534       'egl/gsteglimage.c',
535       'egl/gstglcontext_egl.c',
536       'egl/gstgldisplay_egl.c',
537       'egl/gstglmemoryegl.c',
538       'egl/gstgldisplay_egl_device.c',
539     ]
540     gl_egl_headers += [
541       'egl/egl.h',
542       'egl/gstegl.h',
543       'egl/gsteglimage.h',
544       'egl/gstgldisplay_egl.h',
545       'egl/gstglmemoryegl.h',
546       'egl/gstgldisplay_egl_device.h',
547     ]
548     gl_platform_deps += egl_dep
549     glconf.set10('GST_GL_HAVE_PLATFORM_EGL', 1)
550
551     if cc.has_header('libdrm/drm_fourcc.h')
552       gl_misc_deps += allocators_dep
553       glconf.set10('GST_GL_HAVE_DMABUF', 1)
554     endif
555
556     egl_includes = '''
557 #include <EGL/egl.h>
558 #include <EGL/eglext.h>
559 '''
560     enabled_gl_platforms += 'egl'
561   elif need_platform_egl == 'yes'
562     error ('Could not find requested EGL library')
563   endif
564 endif
565
566 # winsys_egl checks
567 if need_win_egl == 'yes'
568   if need_platform_egl == 'no'
569     error('Impossible situation requested: Cannot use Winsys egl without EGL support')
570   elif not egl_dep.found()
571     error ('Could not find EGL libraries for Winsys egl')
572   else
573     enabled_gl_winsys += 'egl'
574   endif
575 endif
576
577 # wayland checks
578 wayland_client_dep = unneeded_dep
579 wayland_cursor_dep = unneeded_dep
580 wayland_egl_dep = unneeded_dep
581 if need_win_wayland != 'no'
582   if need_win_wayland == 'yes'
583     if need_platform_egl == 'no'
584       error('Impossible situation requested: Cannot use Wayland without EGL support')
585     endif
586   endif
587   if not egl_dep.found()
588     if need_win_wayland == 'yes'
589       error ('Could not find EGL libraries for wayland')
590     else
591       message ('Could not find EGL libraries for wayland')
592     endif
593   else
594     wayland_client_dep = dependency('wayland-client', version : '>= 1.11', required : false)
595     wayland_cursor_dep = dependency('wayland-cursor', version : '>= 1.0', required : false)
596     wayland_egl_dep = dependency('wayland-egl', version : '>= 1.0', required : false)
597     wayland_protocols_dep = dependency('wayland-protocols', version : '>= 1.15', required : false)
598     wayland_scanner = find_program('wayland-scanner', required: false)
599
600     if wayland_client_dep.found() and wayland_cursor_dep.found() and wayland_egl_dep.found() and wayland_protocols_dep.found() and wayland_scanner.found()
601       # Generate the XDG shell interface
602       wayland_protocols_basedir = wayland_protocols_dep.get_pkgconfig_variable('pkgdatadir')
603       xdg_shell_xml_spec = join_paths(wayland_protocols_basedir, 'stable', 'xdg-shell', 'xdg-shell.xml')
604       xdg_shell_header = custom_target('xdg-shell-client-header',
605         command: [ wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ],
606         input: xdg_shell_xml_spec,
607         output: 'xdg-shell-client-protocol.h',
608       )
609       xdg_shell_code = custom_target('xdg-shell-client-code',
610         command: [ wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@' ],
611         input: xdg_shell_xml_spec,
612         output: 'xdg-shell-client-protocol.c',
613       )
614
615       gl_wayland_sources += [
616         'wayland/gstgldisplay_wayland.c',
617       ]
618       gl_priv_sources += [
619         'wayland/gstglwindow_wayland_egl.c',
620         'wayland/wayland_event_source.c',
621         xdg_shell_header,
622         xdg_shell_code,
623       ]
624       gl_wayland_headers += [
625         'wayland/wayland.h',
626         'wayland/gstgldisplay_wayland.h'
627       ]
628       glconf.set('GST_GL_HAVE_WINDOW_WAYLAND', 1)
629       gl_winsys_deps += [wayland_client_dep, wayland_cursor_dep, wayland_egl_dep]
630       enabled_gl_winsys += 'wayland'
631     else
632       if need_win_wayland == 'yes'
633         error ('Could not find requested Wayland libraries')
634       endif
635       wayland_client_dep = unneeded_dep
636       wayland_cursor_dep = unneeded_dep
637       wayland_egl_dep = unneeded_dep
638       wayland_protocols_dep = unneeded_dep
639     endif
640   endif
641 endif
642
643 # X11 checks
644 if need_platform_glx == 'yes'
645   if need_win_x11 == 'no'
646     error('Impossible situation requested: Cannot use GLX without X11 support')
647   elif need_api_opengl == 'no'
648     error('Impossible situation requested: Cannot use GLX without the OpenGL library')
649   endif
650 endif
651
652 if need_win_x11 != 'no'
653   xcb_dep = dependency('x11-xcb', required : false)
654   if x11_dep.found() and xcb_dep.found()
655     gl_x11_sources += [
656       'x11/gstgldisplay_x11.c',
657     ]
658     gl_priv_sources += [
659       'x11/gstglwindow_x11.c',
660       'x11/xcb_event_source.c',
661     ]
662     gl_x11_headers += [
663       'x11/x11.h',
664       'x11/gstgldisplay_x11.h',
665     ]
666     glconf.set('GST_GL_HAVE_WINDOW_X11', 1)
667     gl_winsys_deps += [x11_dep, xcb_dep]
668     enabled_gl_winsys += 'x11'
669
670     if need_platform_glx != 'no' and glx_dep.found() and cc.has_function ('glXMakeCurrent', dependencies : glx_dep)
671       glconf.set('GST_GL_HAVE_PLATFORM_GLX', 1)
672       gl_priv_sources += [
673         'x11/gstglcontext_glx.c',
674       ]
675       # GLX is in the opengl library on linux
676       gl_platform_deps += glx_dep
677       enabled_gl_platforms += 'glx'
678     endif
679   elif need_win_x11 == 'yes'
680     error ('Could not find requested X11 libraries')
681   endif
682 endif
683
684 if need_win_dispmanx != 'no'
685   if bcm_host_dep.found()
686     if not egl_dep.found()
687       error('dispmanx requires the use of egl')
688     endif
689
690     gl_priv_sources += [
691       'dispmanx/gstglwindow_dispmanx_egl.c'
692     ]
693
694     glconf.set('GST_GL_HAVE_WINDOW_DISPMANX', 1)
695     gl_winsys_deps += bcm_host_dep
696     enabled_gl_winsys += 'dispmanx'
697     gl_cpp_args += ['-DUSE_EGL_RPI']
698   elif need_win_dispmanx == 'yes'
699     error('Could not find dispmanx libraries')
700   endif
701 endif
702
703 # win32 checks
704 if need_platform_wgl == 'yes'
705   if need_win_win32 == 'no'
706     error('Impossible situation requested: Cannot use WGL without the win32 window system')
707   endif
708 endif
709
710 if host_system == 'windows' and need_win_win32 != 'no'
711   gdi_dep = cc.find_library('gdi32', required : false)
712   if gdi_dep.found()
713     have_wgl = false
714     have_egl_win32 = false
715     if need_platform_wgl != 'no'
716       wglext_h = cc.has_header('GL/wglext.h',
717                                prefix : '''#include <windows.h>
718                                            #include <GL/gl.h>''',
719                                include_directories : compat_includes)
720       have_wgl = wglext_h and gl_dep.found()
721     endif
722
723     have_egl_win32 = enabled_gl_platforms.contains('egl') and gles2_dep.found()
724     if have_wgl or have_egl_win32
725       gl_includes += [compat_includes]
726       gl_platform_deps += gdi_dep
727       gl_priv_sources += [
728         'win32/gstglwindow_win32.c',
729       ]
730       enabled_gl_winsys += 'win32'
731       gl_winsys_deps += gdi_dep
732       glconf.set('GST_GL_HAVE_WINDOW_WIN32', 1)
733     endif
734
735     if have_wgl
736       gl_priv_sources += [
737         'wgl/gstglcontext_wgl.c',
738       ]
739       enabled_gl_platforms += 'wgl'
740       glconf.set('GST_GL_HAVE_PLATFORM_WGL', 1)
741     endif
742   endif
743 endif
744
745 # WinRT ANGLE checks
746 if need_win_winrt != 'no' and host_system == 'windows'
747   if need_win_winrt == 'yes' and not enabled_gl_platforms.contains('egl')
748     error('Impossible situation requested: Cannot use WinRT ANGLE without EGL support')
749   endif
750
751   if egl_dep.found()
752     windows_graphics_h = cc.has_header('windows.graphics.h')
753     windows_app_dep = cc.find_library('WindowsApp', required: false)
754     runtimeobject_lib = cc.find_library('runtimeobject', required: false)
755
756     if windows_graphics_h and windows_app_dep.found() and runtimeobject_lib.found()
757       enabled_gl_winsys += 'winrt'
758       glconf.set10('GST_GL_HAVE_WINDOW_WINRT', 1)
759       gl_priv_sources += [
760         'winrt/gstglwindow_winrt_egl.cpp'
761       ]
762       gl_winsys_deps += runtimeobject_lib
763     elif need_win_winrt == 'yes'
764       error('WinRT is enabled, but headers/libraries were not found')
765     endif
766   elif need_win_winrt == 'yes'
767     error('WinRT ANGLE is enabled, but EGL was not found')
768   else
769     message('WinRT ANGLE disabled because EGL was not found')
770   endif
771 endif
772
773 if ['darwin', 'ios'].contains(host_system)
774   if not have_objc
775     error('No ObjC compiler found')
776   endif
777
778   objc = meson.get_compiler('objc')
779   if not objc.has_argument('-fobjc-arc')
780     error('ARC is required for building')
781   endif
782
783   gl_objc_args += ['-fobjc-arc']
784 endif
785
786 # OSX check
787 if need_platform_cgl == 'yes'
788   if need_win_cocoa == 'no'
789     error('Impossible situation requested: Cannot use CGL without Cocoa support')
790   elif need_api_opengl == 'no'
791     error('Impossible situation requested: Cannot use CGL without the OpenGL library')
792   endif
793 elif need_platform_cgl == 'no' and need_win_cocoa == 'yes'
794   error('Impossible situation requested: Cannot use Cocoa without CGL support')
795 endif
796
797 if host_system == 'darwin'
798   foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : false)
799   quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : false)
800   corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : false)
801
802   if need_platform_cgl != 'no'
803     if foundation_dep.found() and quartzcore_dep.found() and corefoundation_dep.found()
804       gl_platform_deps += [quartzcore_dep, corefoundation_dep, foundation_dep]
805       enabled_gl_platforms += 'cgl'
806       glconf.set10('GST_GL_HAVE_PLATFORM_CGL', 1)
807
808       if need_win_cocoa != 'no'
809         cocoa_dep = dependency('appleframeworks', modules : ['Cocoa'], required : false)
810         if cocoa_dep.found()
811           gl_priv_sources += [
812             'cocoa/gstglcaopengllayer.m',
813             'cocoa/gstglcontext_cocoa.m',
814             'cocoa/gstgldisplay_cocoa.m',
815             'cocoa/gstglwindow_cocoa.m'
816           ]
817           gl_winsys_deps += cocoa_dep
818           enabled_gl_winsys += 'cocoa'
819           glconf.set10('GST_GL_HAVE_WINDOW_COCOA', 1)
820         elif need_win_cocoa == 'yes'
821           error('Could not find Cocoa')
822         endif
823       endif
824     elif need_platform_cgl == 'yes'
825       error('Could not find CGL dependencies')
826     endif
827   endif
828 endif
829
830 if need_platform_eagl == 'yes'
831   if host_system != 'ios'
832     error('Can only use EAGL on iOS')
833   endif
834   if need_win_eagl == 'no'
835     error('Impossible situation requested: Cannot use EAGL platform without the EAGL window system')
836   elif need_api_gles == 'no'
837     error('Impossible situation requested: Cannot use EAGL platform without the GLES library')
838   endif
839 elif need_platform_eagl == 'no' and need_win_eagl == 'yes'
840   error('Impossible situation requested: Cannot use EAGL window system without the EAGL platform')
841 endif
842
843 if host_system == 'ios' and need_platform_eagl != 'no' and need_win_eagl != 'no'
844   foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : false)
845   corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : false)
846   coregraphics_dep = dependency('appleframeworks', modules : ['CoreGraphics'], required : false)
847   quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : false)
848   uikit_dep = dependency('appleframeworks', modules : ['UIkit'], required : false)
849
850   if foundation_dep.found() and corefoundation_dep.found() and coregraphics_dep.found() and quartzcore_dep.found() and uikit_dep.found()
851     gl_platform_deps += [
852       corefoundation_dep,
853       foundation_dep,
854       coregraphics_dep,
855       quartzcore_dep,
856       uikit_dep,
857     ]
858     gl_priv_sources += [
859       'eagl/gstglcontext_eagl.m',
860       'eagl/gstglwindow_eagl.m',
861     ]
862     enabled_gl_winsys += 'eagl'
863     enabled_gl_platforms += 'eagl'
864     glconf.set('GST_GL_HAVE_WINDOW_EAGL', 1)
865     glconf.set('GST_GL_HAVE_PLATFORM_EAGL', 1)
866   elif need_platform_eagl == 'yes' or need_win_eagl == 'yes'
867     error('Could not find dependencies for EAGL')
868   endif
869 endif
870
871 # GBM Checks
872 gbm_gudev_dep = unneeded_dep
873 gbm_libdrm_dep = unneeded_dep
874 gbm_dep = unneeded_dep
875 if need_win_gbm != 'no'
876   if need_win_gbm == 'yes'
877     if need_platform_egl == 'no'
878       error('Impossible situation requested: Cannot use GBM without EGL support')
879     endif
880   endif
881
882   gbm_gudev_dep = dependency('gudev-1.0', version : '>=147', required : false)
883   gbm_libdrm_dep = dependency('libdrm', version : '>= 2.4.55', required : false)
884   gbm_dep = dependency('gbm', required : false)
885   if egl_dep.found() and gbm_gudev_dep.found() and gbm_libdrm_dep.found() and gbm_dep.found()
886     gl_priv_sources += [
887       'gbm/gstgldisplay_gbm.c',
888       'gbm/gstgl_gbm_utils.c',
889       'gbm/gstglwindow_gbm_egl.c',
890     ]
891     enabled_gl_winsys += 'gbm'
892     gl_winsys_deps += [gbm_gudev_dep, gbm_libdrm_dep, gbm_dep]
893     glconf.set('GST_GL_HAVE_WINDOW_GBM', 1)
894   else
895     if need_win_gbm == 'yes'
896       error ('Could not find requested GBM libraries')
897     endif
898     gbm_gudev_dep = unneeded_dep
899     gbm_libdrm_dep = unneeded_dep
900     gbm_dep = unneeded_dep
901   endif
902 endif
903
904 if need_platform_egl != 'no' and need_win_viv_fb != 'no'
905   if egl_dep.found() and cc.has_function ('fbGetDisplay', dependencies : egl_dep)
906     if cc.has_function ('glTexDirectVIV', dependencies : gles2_dep)
907       enabled_gl_winsys += 'viv-fb'
908       glconf.set10('GST_GL_HAVE_WINDOW_VIV_FB', 1)
909       glconf.set10('GST_GL_HAVE_VIV_DIRECTVIV', 1)
910       gl_priv_sources += [
911         'viv-fb/gstgldisplay_viv_fb.c',
912         'viv-fb/gstglwindow_viv_fb_egl.c',
913       ]
914       gl_cpp_args += ['-DEGL_API_FB']
915     endif
916   endif
917 endif
918
919 if need_win_android == 'yes'
920   if need_platform_egl == 'no'
921     error('Impossible situation requested: Cannot build for Android without EGL')
922   elif need_api_gles2 == 'no'
923     error('Impossible situation requested: Cannot build for Android without GLES2 support')
924   elif host_system != 'android'
925     error('Impossible situation requested: Cannot build for Android without an android system')
926   endif
927 endif
928
929 if host_system == 'android' and need_win_android != 'no' and need_platform_egl != 'no'
930   if gles2_dep.found() and egl_dep.found()
931     enabled_gl_winsys += ['android']
932     glconf.set10('GST_GL_HAVE_WINDOW_ANDROID', 1)
933     gl_priv_sources += [
934       'android/gstglwindow_android_egl.c'
935     ]
936   endif
937 endif
938
939 gl_nvmm = false
940 nvbuf_utils_dep = unneeded_dep
941 if egl_dep.found()
942   # XXX: provide options for this?
943   # c_args and c_link_args can also cover this case just fine e.g.:
944   # -Dc_args='-I/usr/src/jetson_multimedia_api/include' -Dc_link_args='-L/usr/lib/aarch64-linux-gnu/tegra/'
945   nvbuf_utils_dep = cc.find_library('nvbuf_utils', required : false)
946   nvbuf_utils_h = cc.has_header('nvbuf_utils.h')
947   if nvbuf_utils_dep.found() and nvbuf_utils_h
948     gl_misc_deps += [nvbuf_utils_dep]
949     gl_nvmm = true
950     gl_cpp_args += ['-DHAVE_NVMM']
951   endif
952 endif
953
954 build_gstgl = true
955 if enabled_gl_apis.length() == 0
956   message('No OpenGL API libraries found or requested')
957   build_gstgl = false
958 endif
959 if enabled_gl_platforms.length() == 0
960   message('No OpenGL Platforms found or requested')
961   build_gstgl = false
962 endif
963 if enabled_gl_winsys.length() == 0
964   message('No OpenGL Window systems found or requested')
965   build_gstgl = false
966 endif
967
968 gstgl_dep = dependency('', required : false)
969 gstglproto_dep = dependency('', required : false)
970 gstglx11_dep = dependency('', required : false)
971 gstglwayland_dep = dependency('', required : false)
972 gstglegl_dep = dependency('', required : false)
973
974 if build_gstgl
975   # find some types that may or may not be defined
976   if cc.has_type('GLeglImageOES', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
977     glconf.set('GST_GL_HAVE_GLEGLIMAGEOES', 1)
978   endif
979   if cc.has_type('GLchar', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
980     glconf.set('GST_GL_HAVE_GLCHAR', 1)
981   endif
982   if cc.has_type('GLsizeiptr', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
983     glconf.set('GST_GL_HAVE_GLSIZEIPTR', 1)
984   endif
985   if cc.has_type('GLintptr', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
986     glconf.set('GST_GL_HAVE_GLINTPTR', 1)
987   endif
988   if cc.has_type('GLsync', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
989     glconf.set('GST_GL_HAVE_GLSYNC', 1)
990   endif
991   if cc.has_type('GLuint64', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
992     glconf.set('GST_GL_HAVE_GLUINT64', 1)
993   endif
994   if cc.has_type('GLint64', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
995     glconf.set('GST_GL_HAVE_GLINT64', 1)
996   endif
997   if egl_dep.found() and cc.has_type('EGLAttrib', prefix : gl_include_block + egl_includes, dependencies : gl_lib_deps + [egl_dep], include_directories : gl_includes)
998     glconf.set('GST_GL_HAVE_EGLATTRIB', 1)
999   endif
1000   if egl_dep.found() and cc.has_type('EGLuint64KHR', prefix : gl_include_block + egl_includes, dependencies : gl_lib_deps + [egl_dep], include_directories : gl_includes)
1001     glconf.set('GST_GL_HAVE_EGLUINT64KHR', 1)
1002   endif
1003
1004   summary('GL api', enabled_gl_apis, list_sep: ', ')
1005   summary('GL platform', enabled_gl_platforms, list_sep: ', ')
1006   summary('GL winsys', enabled_gl_winsys, list_sep: ', ')
1007
1008   install_headers(gl_headers, subdir : 'gstreamer-1.0/gst/gl')
1009   install_headers(gl_prototype_headers, subdir : 'gstreamer-1.0/gst/gl/glprototypes')
1010
1011   configure_file(input : 'gstglconfig.h.meson',
1012     output : 'gstglconfig.h',
1013     install_dir : get_option('libdir') + '/gstreamer-1.0/include/gst/gl',
1014     configuration : glconf)
1015
1016   glib_mkenums = find_program('glib-mkenums')
1017   mkenums = find_program('gl_mkenum.py')
1018   gl_enumtypes_h = custom_target('gstglenumtypes_h',
1019     output : 'gl-enumtypes.h',
1020     input : gir_gl_headers,
1021     install : true,
1022     install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/gl/'),
1023     command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
1024
1025   gl_enumtypes_c = custom_target('gstglenumtypes_c',
1026     output : 'gl-enumtypes.c',
1027     input : gir_gl_headers,
1028     depends : [gl_enumtypes_h],
1029     command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
1030   gen_sources = [gl_enumtypes_h]
1031
1032   common_args = gst_plugins_base_args + gl_cpp_args + ['-DBUILDING_GST_GL']
1033
1034   # We have custom_target() that generate headers in the current build dir,
1035   # but with implicit_include_directories: false, meson >= 0.58.0 won't include
1036   # it by default. We cannot use include_directories('.') here because it would
1037   # also include current source dir which is what we want to avoid because
1038   # case-insensitive FS would include gst-libs/gl/egl/egl.h as EGL/egl.h.
1039   common_args += '-I@0@'.format(meson.current_build_dir())
1040
1041   gstgl = library('gstgl-' + api_version,
1042     gl_sources, gl_egl_sources, gl_x11_sources, gl_wayland_sources, gl_priv_sources, gl_enumtypes_c, gl_enumtypes_h,
1043     c_args : common_args,
1044     cpp_args : common_args,
1045     objc_args : common_args + gl_objc_args,
1046     include_directories : [configinc, libsinc, gl_includes],
1047     version : libversion,
1048     soversion : soversion,
1049     darwin_versions : osxversion,
1050     install : true,
1051     dependencies : [gst_base_dep, video_dep, allocators_dep, gmodule_dep,
1052                     gl_lib_deps, gl_platform_deps, gl_winsys_deps, gl_misc_deps],
1053     # don't confuse EGL/egl.h with gst-libs/gl/egl/egl.h on case-insensitive file systems
1054     implicit_include_directories : false)
1055
1056   pkgconfig_gl_variables = [
1057     'gl_platforms=' + ' '.join(enabled_gl_platforms),
1058     'gl_winsys=' + ' '.join(enabled_gl_winsys),
1059     'gl_apis=' + ' '.join(enabled_gl_apis),
1060   ]
1061
1062   pkgconfig.generate(gstgl,
1063     libraries : [gstvideo, gst_base_dep, gst_dep],
1064     variables : pkgconfig_variables + pkgconfig_gl_variables,
1065     uninstalled_variables : pkgconfig_gl_variables,
1066     subdirs : pkgconfig_subdirs,
1067     extra_cflags : ['-I${libdir}/gstreamer-1.0/include'],
1068     name : 'gstreamer-gl-1.0',
1069     description : 'Streaming media framework, OpenGL plugins libraries',
1070   )
1071
1072   # Desperate times, desperate measures... fix up escaping of our variables
1073   run_command(meson_pkg_config_file_fixup_script,
1074     'gstreamer-gl-1.0', 'gl_platforms', 'gl_winsys', 'gl_apis',
1075     check: true)
1076
1077   pkgconfig.generate(
1078     libraries : [gstgl, gl_lib_deps],
1079     subdirs : pkgconfig_subdirs,
1080     name : 'gstreamer-gl-prototypes-1.0',
1081     description : 'Streaming media framework, OpenGL plugins libraries (OpenGL Prototypes)',
1082   )
1083
1084   if build_gir
1085     gl_gir = gnome.generate_gir(gstgl,
1086       sources : gl_sources + [gl_enumtypes_h] + [gl_enumtypes_c] + gir_gl_headers,
1087       namespace : 'GstGL',
1088       nsversion : api_version,
1089       identifier_prefix : 'Gst',
1090       symbol_prefix : 'gst',
1091       export_packages : 'gstreamer-gl-1.0',
1092       includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
1093       install : true,
1094       extra_args : gir_init_section + ['--c-include=gst/gl/gl.h'],
1095       dependencies : [video_dep, gst_dep, gst_base_dep]
1096     )
1097     gen_sources += gl_gir
1098   endif
1099
1100   gstgl_dep = declare_dependency(link_with : gstgl,
1101     include_directories : [libsinc, compat_includes],
1102     sources: gen_sources,
1103     dependencies : [video_dep, gst_base_dep])
1104   gstglproto_dep = declare_dependency(dependencies : [gstgl_dep] + gl_lib_deps)
1105   meson.override_dependency('gstreamer-gl-1.0', gstgl_dep)
1106   meson.override_dependency('gstreamer-gl-prototypes-1.0', gstglproto_dep)
1107
1108   if gl_x11_headers.length() > 0
1109     install_headers(gl_x11_headers, subdir : 'gstreamer-1.0/gst/gl/x11')
1110     pkgconfig.generate(
1111       libraries : [gstgl],
1112       requires: ['x11-xcb'],
1113       subdirs : pkgconfig_subdirs,
1114       name : 'gstreamer-gl-x11-1.0',
1115       description : 'Streaming media framework, OpenGL plugins libraries (X11 specifics)',
1116     )
1117     gl_x11_gir = []
1118     if build_gir
1119       gl_x11_gir = gnome.generate_gir(gstgl,
1120         sources : gl_x11_sources + gl_x11_headers,
1121         namespace : 'GstGLX11',
1122         nsversion : api_version,
1123         identifier_prefix : 'Gst',
1124         symbol_prefix : 'gst',
1125         export_packages : 'gstreamer-gl-x11-1.0',
1126         includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0', gl_gir[0]],
1127         install : true,
1128         extra_args : gir_init_section + ['--c-include=gst/gl/x11/x11.h'],
1129         dependencies : [video_dep, gst_dep, gst_base_dep]
1130       )
1131     endif
1132     gstglx11_dep = declare_dependency(dependencies : [gstgl_dep],
1133       sources : gl_x11_gir)
1134     meson.override_dependency('gstreamer-gl-x11-1.0', gstglx11_dep)
1135   endif
1136
1137   if gl_wayland_headers.length() > 0
1138     install_headers(gl_wayland_headers, subdir : 'gstreamer-1.0/gst/gl/wayland')
1139     pkgconfig.generate(
1140       libraries : [gstgl],
1141       requires: ['wayland-egl', 'wayland-client'],
1142       subdirs : pkgconfig_subdirs,
1143       name : 'gstreamer-gl-wayland-1.0',
1144       description : 'Streaming media framework, OpenGL plugins libraries (Wayland specifics)',
1145     )
1146     gl_wayland_gir = []
1147     if build_gir
1148       gl_wayland_gir = gnome.generate_gir(gstgl,
1149         sources : gl_wayland_sources + gl_wayland_headers,
1150         namespace : 'GstGLWayland',
1151         nsversion : api_version,
1152         identifier_prefix : 'Gst',
1153         symbol_prefix : 'gst',
1154         export_packages : 'gstreamer-gl-wayland-1.0',
1155         includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0', gl_gir[0]],
1156         install : true,
1157         extra_args : gir_init_section + ['--c-include=gst/gl/wayland/wayland.h'],
1158         dependencies : [video_dep, gst_dep, gst_base_dep]
1159       )
1160     endif
1161     gstglwayland_dep = declare_dependency(dependencies : [gstgl_dep],
1162       sources : gl_wayland_gir)
1163     meson.override_dependency('gstreamer-gl-wayland-1.0', gstglwayland_dep)
1164   endif
1165
1166   if gl_egl_headers.length() > 0
1167     install_headers(gl_egl_headers, subdir : 'gstreamer-1.0/gst/gl/egl')
1168     pkgconfig.generate(
1169       libraries : [gstgl, egl_dep],
1170       subdirs : pkgconfig_subdirs,
1171       name : 'gstreamer-gl-egl-1.0',
1172       description : 'Streaming media framework, OpenGL plugins libraries (EGL specifics)',
1173     )
1174     gl_egl_gir = []
1175     if build_gir
1176       gl_egl_gir = gnome.generate_gir(gstgl,
1177         sources : gl_egl_sources + gl_egl_headers,
1178         namespace : 'GstGLEGL',
1179         nsversion : api_version,
1180         identifier_prefix : 'Gst',
1181         symbol_prefix : 'gst',
1182         export_packages : 'gstreamer-gl-egl-1.0',
1183         includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0', gl_gir[0]],
1184         install : true,
1185         extra_args : gir_init_section + ['--c-include=gst/gl/egl/egl.h'],
1186         dependencies : [video_dep, gst_dep, gst_base_dep]
1187       )
1188     endif
1189     gstglegl_dep = declare_dependency(dependencies : [gstgl_dep],
1190       sources : gl_egl_gir)
1191     meson.override_dependency('gstreamer-gl-egl-1.0', gstglegl_dep)
1192   endif
1193
1194 elif get_option('gl').enabled()
1195   error('GStreamer OpenGL integration required via options, but needed dependencies not found.')
1196 endif