2022-03-29 15:51:13 +00:00
|
|
|
gstgl_dep = dependency('', required : false)
|
|
|
|
gstglproto_dep = dependency('', required : false)
|
|
|
|
gstglx11_dep = dependency('', required : false)
|
|
|
|
gstglwayland_dep = dependency('', required : false)
|
|
|
|
gstglegl_dep = dependency('', required : false)
|
|
|
|
|
2018-08-16 09:28:48 +00:00
|
|
|
if get_option('gl').disabled()
|
|
|
|
message('GStreamer OpenGL integration disabled via options.')
|
|
|
|
build_gstgl = false
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_sources = files([
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstglapi.c',
|
|
|
|
'gstglbasefilter.c',
|
|
|
|
'gstglbasememory.c',
|
2019-08-07 15:15:40 +00:00
|
|
|
'gstglbasesrc.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstglcolorconvert.c',
|
|
|
|
'gstglbuffer.c',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstglbufferpool.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstglcontext.c',
|
2020-09-08 06:27:03 +00:00
|
|
|
'gstglcontextconfig.c',
|
2022-05-09 06:21:55 +00:00
|
|
|
'gstglcontextquirks.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstgldebug.c',
|
|
|
|
'gstgldisplay.c',
|
|
|
|
'gstglfeature.c',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstglfilter.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstglformat.c',
|
|
|
|
'gstglframebuffer.c',
|
|
|
|
'gstglmemory.c',
|
|
|
|
'gstglmemorypbo.c',
|
|
|
|
'gstgloverlaycompositor.c',
|
|
|
|
'gstglquery.c',
|
|
|
|
'gstglrenderbuffer.c',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstglshader.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstglshaderstrings.c',
|
|
|
|
'gstglsl.c',
|
|
|
|
'gstglslstage.c',
|
|
|
|
'gstglsyncmeta.c',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstglupload.c',
|
|
|
|
'gstglutils.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'gstglviewconvert.c',
|
|
|
|
'gstglwindow.c',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2016-08-12 15:51:45 +00:00
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources = []
|
2019-03-23 21:51:37 +00:00
|
|
|
|
2020-06-27 04:37:39 +00:00
|
|
|
gir_gl_headers = files([
|
2016-08-12 15:51:45 +00:00
|
|
|
'gl.h',
|
2018-03-13 10:57:15 +00:00
|
|
|
'gl-prelude.h',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstgl_enums.h',
|
|
|
|
'gstgl_fwd.h',
|
|
|
|
'gstglapi.h',
|
|
|
|
'gstglbasefilter.h',
|
|
|
|
'gstglbasememory.h',
|
2019-08-07 15:15:40 +00:00
|
|
|
'gstglbasesrc.h',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstglbuffer.h',
|
|
|
|
'gstglbufferpool.h',
|
|
|
|
'gstglcolorconvert.h',
|
|
|
|
'gstglcontext.h',
|
2020-09-08 06:27:03 +00:00
|
|
|
'gstglcontextconfig.h',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstgldebug.h',
|
|
|
|
'gstgldisplay.h',
|
|
|
|
'gstglfeature.h',
|
|
|
|
'gstglfilter.h',
|
|
|
|
'gstglformat.h',
|
|
|
|
'gstglframebuffer.h',
|
|
|
|
'gstglmemory.h',
|
|
|
|
'gstglmemorypbo.h',
|
|
|
|
'gstgloverlaycompositor.h',
|
|
|
|
'gstglquery.h',
|
2017-04-11 12:46:19 +00:00
|
|
|
'gstglrenderbuffer.h',
|
2016-08-12 15:51:45 +00:00
|
|
|
'gstglshader.h',
|
|
|
|
'gstglshaderstrings.h',
|
|
|
|
'gstglsl.h',
|
|
|
|
'gstglslstage.h',
|
|
|
|
'gstglsyncmeta.h',
|
|
|
|
'gstglupload.h',
|
|
|
|
'gstglutils.h',
|
|
|
|
'gstglviewconvert.h',
|
|
|
|
'gstglwindow.h',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_headers = gir_gl_headers + files([
|
2018-09-03 06:20:33 +00:00
|
|
|
'gstglfuncs.h',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2018-09-03 06:20:33 +00:00
|
|
|
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_prototype_headers = files([
|
2016-09-09 01:08:53 +00:00
|
|
|
'glprototypes/all_functions.h',
|
|
|
|
'glprototypes/base.h',
|
2021-06-04 08:32:07 +00:00
|
|
|
'glprototypes/buffer_storage.h',
|
2016-09-09 01:08:53 +00:00
|
|
|
'glprototypes/blending.h',
|
|
|
|
'glprototypes/buffers.h',
|
|
|
|
'glprototypes/debug.h',
|
|
|
|
'glprototypes/eglimage.h',
|
|
|
|
'glprototypes/fbo.h',
|
|
|
|
'glprototypes/fixedfunction.h',
|
|
|
|
'glprototypes/gles.h',
|
|
|
|
'glprototypes/gstgl_compat.h',
|
|
|
|
'glprototypes/gstgl_gles2compat.h',
|
|
|
|
'glprototypes/opengl.h',
|
|
|
|
'glprototypes/query.h',
|
|
|
|
'glprototypes/shaders.h',
|
|
|
|
'glprototypes/sync.h',
|
|
|
|
'glprototypes/vao.h',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_x11_sources = []
|
2016-09-09 01:08:53 +00:00
|
|
|
gl_x11_headers = []
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_wayland_sources = []
|
2016-09-09 01:08:53 +00:00
|
|
|
gl_wayland_headers = []
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_egl_sources = []
|
2016-09-09 01:08:53 +00:00
|
|
|
gl_egl_headers = []
|
2016-08-12 15:51:45 +00:00
|
|
|
|
|
|
|
glconf = configuration_data()
|
2017-04-07 19:19:27 +00:00
|
|
|
glconf_options = [
|
|
|
|
'GST_GL_HAVE_OPENGL',
|
|
|
|
'GST_GL_HAVE_GLES2',
|
|
|
|
'GST_GL_HAVE_GLES3',
|
2017-05-11 10:05:24 +00:00
|
|
|
'GST_GL_HAVE_GLES3EXT3_H',
|
2017-04-07 19:19:27 +00:00
|
|
|
|
|
|
|
'GST_GL_HAVE_WINDOW_X11',
|
|
|
|
'GST_GL_HAVE_WINDOW_COCOA',
|
|
|
|
'GST_GL_HAVE_WINDOW_WIN32',
|
2019-05-21 06:14:39 +00:00
|
|
|
'GST_GL_HAVE_WINDOW_WINRT',
|
2017-04-07 19:19:27 +00:00
|
|
|
'GST_GL_HAVE_WINDOW_WAYLAND',
|
|
|
|
'GST_GL_HAVE_WINDOW_ANDROID',
|
|
|
|
'GST_GL_HAVE_WINDOW_DISPMANX',
|
|
|
|
'GST_GL_HAVE_WINDOW_EAGL',
|
|
|
|
'GST_GL_HAVE_WINDOW_VIV_FB',
|
2018-04-16 09:10:45 +00:00
|
|
|
'GST_GL_HAVE_WINDOW_GBM',
|
2017-04-07 19:19:27 +00:00
|
|
|
|
|
|
|
'GST_GL_HAVE_PLATFORM_EGL',
|
|
|
|
'GST_GL_HAVE_PLATFORM_GLX',
|
|
|
|
'GST_GL_HAVE_PLATFORM_WGL',
|
|
|
|
'GST_GL_HAVE_PLATFORM_CGL',
|
|
|
|
'GST_GL_HAVE_PLATFORM_EAGL',
|
|
|
|
|
|
|
|
'GST_GL_HAVE_DMABUF',
|
|
|
|
'GST_GL_HAVE_VIV_DIRECTVIV',
|
|
|
|
|
|
|
|
'GST_GL_HAVE_GLEGLIMAGEOES',
|
|
|
|
'GST_GL_HAVE_GLCHAR',
|
|
|
|
'GST_GL_HAVE_GLSIZEIPTR',
|
|
|
|
'GST_GL_HAVE_GLINTPTR',
|
|
|
|
'GST_GL_HAVE_GLSYNC',
|
|
|
|
'GST_GL_HAVE_GLUINT64',
|
|
|
|
'GST_GL_HAVE_GLINT64',
|
|
|
|
'GST_GL_HAVE_EGLATTRIB',
|
2018-07-16 14:01:34 +00:00
|
|
|
'GST_GL_HAVE_EGLUINT64KHR',
|
2017-04-07 19:19:27 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
foreach option : glconf_options
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set(option, 0)
|
2017-04-07 19:19:27 +00:00
|
|
|
endforeach
|
2016-08-12 15:51:45 +00:00
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
unneeded_dep = dependency('', required : false)
|
|
|
|
if unneeded_dep.found()
|
|
|
|
error ('Found unfindable dependency')
|
|
|
|
endif
|
2016-08-12 15:51:45 +00:00
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
# OpenGL/GLES2 libraries
|
|
|
|
gl_lib_deps = []
|
|
|
|
# GL platform - EGL, GLX, CGL, WGL, etc
|
|
|
|
gl_platform_deps = []
|
|
|
|
# GL winsys - wayland, X11, Cocoa, win32, etc
|
|
|
|
gl_winsys_deps = []
|
|
|
|
# other things we need.
|
|
|
|
gl_misc_deps = []
|
2016-10-19 05:11:58 +00:00
|
|
|
# Other preprocessor arguments
|
2018-06-04 12:34:04 +00:00
|
|
|
gl_cpp_args = []
|
2018-06-18 12:24:13 +00:00
|
|
|
gl_includes = []
|
2017-07-21 06:59:28 +00:00
|
|
|
gl_objc_args = []
|
2016-09-09 01:08:53 +00:00
|
|
|
|
|
|
|
enabled_gl_apis = []
|
|
|
|
enabled_gl_platforms = []
|
|
|
|
enabled_gl_winsys = []
|
|
|
|
|
|
|
|
# parse provided options
|
2018-05-05 13:55:20 +00:00
|
|
|
libegl_module_name = get_option('egl_module_name')
|
2016-10-19 05:11:58 +00:00
|
|
|
if libegl_module_name != ''
|
|
|
|
gl_cpp_args += ['-DGST_GL_LIBEGL_MODULE_NAME="@0@"'.format(libegl_module_name)]
|
|
|
|
endif
|
2018-05-05 13:55:20 +00:00
|
|
|
libgles2_module_name = get_option('gles2_module_name')
|
2016-10-19 05:11:58 +00:00
|
|
|
if libgles2_module_name != ''
|
|
|
|
gl_cpp_args += ['-DGST_GL_LIBGLESV2_MODULE_NAME="@0@"'.format(libgles2_module_name)]
|
|
|
|
endif
|
2018-05-05 13:55:20 +00:00
|
|
|
libgl_module_name = get_option('opengl_module_name')
|
2016-10-19 05:11:58 +00:00
|
|
|
if libgl_module_name != ''
|
|
|
|
gl_cpp_args += ['-DGST_GL_LIBGL_MODULE_NAME="@0@"'.format(libgl_module_name)]
|
|
|
|
endif
|
|
|
|
|
2018-05-05 13:55:20 +00:00
|
|
|
gl_apis = get_option('gl_api')
|
|
|
|
if gl_apis.contains('auto')
|
2016-09-09 01:08:53 +00:00
|
|
|
need_api_opengl = 'auto'
|
|
|
|
need_api_gles2 = 'auto'
|
|
|
|
else
|
|
|
|
need_api_opengl = 'no'
|
|
|
|
need_api_gles2 = 'no'
|
|
|
|
foreach api : gl_apis
|
|
|
|
if api == 'opengl'
|
|
|
|
need_api_opengl = 'yes'
|
|
|
|
elif api == 'gles2'
|
|
|
|
need_api_gles2 = 'yes'
|
|
|
|
else
|
|
|
|
error('Unsupported GL api provided ' + api)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
2018-05-05 13:55:20 +00:00
|
|
|
gl_platforms = get_option('gl_platform')
|
|
|
|
if gl_platforms.contains('auto')
|
2016-09-09 01:08:53 +00:00
|
|
|
need_platform_egl = 'auto'
|
|
|
|
need_platform_glx = 'auto'
|
|
|
|
need_platform_cgl = 'auto'
|
|
|
|
need_platform_wgl = 'auto'
|
|
|
|
need_platform_eagl = 'auto'
|
|
|
|
else
|
|
|
|
need_platform_egl = 'no'
|
|
|
|
need_platform_glx = 'no'
|
|
|
|
need_platform_cgl = 'no'
|
|
|
|
need_platform_wgl = 'no'
|
|
|
|
need_platform_eagl = 'no'
|
|
|
|
foreach platform : gl_platforms
|
|
|
|
if platform == 'egl'
|
|
|
|
need_platform_egl = 'yes'
|
|
|
|
elif platform == 'glx'
|
|
|
|
need_platform_glx = 'yes'
|
2017-07-21 06:59:28 +00:00
|
|
|
elif platform == 'cgl'
|
|
|
|
need_platform_cgl = 'yes'
|
2016-10-27 01:59:36 +00:00
|
|
|
elif platform == 'wgl'
|
|
|
|
need_platform_wgl = 'yes'
|
2018-08-02 05:59:20 +00:00
|
|
|
elif platform == 'eagl'
|
|
|
|
need_platform_eagl = 'yes'
|
2016-09-09 01:08:53 +00:00
|
|
|
else
|
|
|
|
error('Unsupported GL platform provided ' + platform)
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
2018-05-05 13:55:20 +00:00
|
|
|
gl_winsys = get_option('gl_winsys')
|
|
|
|
if gl_winsys.contains('auto')
|
2016-09-09 01:08:53 +00:00
|
|
|
need_win_x11 = 'auto'
|
|
|
|
need_win_wayland = 'auto'
|
|
|
|
need_win_win32 = 'auto'
|
2019-05-21 06:14:39 +00:00
|
|
|
need_win_winrt = 'auto'
|
2016-09-09 01:08:53 +00:00
|
|
|
need_win_cocoa = 'auto'
|
2019-12-16 18:49:09 +00:00
|
|
|
need_win_egl = 'auto'
|
2016-09-09 01:08:53 +00:00
|
|
|
need_win_eagl = 'auto'
|
|
|
|
need_win_dispmanx = 'auto'
|
2017-08-23 06:36:09 +00:00
|
|
|
need_win_viv_fb = 'auto'
|
2018-02-23 21:39:32 +00:00
|
|
|
need_win_gbm = 'auto'
|
2018-08-30 14:15:35 +00:00
|
|
|
need_win_android = 'auto'
|
2016-09-09 01:08:53 +00:00
|
|
|
else
|
|
|
|
need_win_x11 = 'no'
|
|
|
|
need_win_wayland = 'no'
|
|
|
|
need_win_win32 = 'no'
|
2019-05-21 06:14:39 +00:00
|
|
|
need_win_winrt = 'no'
|
2016-09-09 01:08:53 +00:00
|
|
|
need_win_cocoa = 'no'
|
2019-12-16 18:49:09 +00:00
|
|
|
need_win_egl = 'no'
|
2016-09-09 01:08:53 +00:00
|
|
|
need_win_eagl = 'no'
|
|
|
|
need_win_dispmanx = 'no'
|
2017-08-23 06:36:09 +00:00
|
|
|
need_win_viv_fb = 'no'
|
2018-02-23 21:39:32 +00:00
|
|
|
need_win_gbm = 'no'
|
2018-08-30 14:15:35 +00:00
|
|
|
need_win_android = 'no'
|
2016-09-09 01:08:53 +00:00
|
|
|
foreach winsys : gl_winsys
|
|
|
|
if winsys == 'x11'
|
|
|
|
need_win_x11 = 'yes'
|
|
|
|
elif winsys == 'wayland'
|
|
|
|
need_win_wayland = 'yes'
|
2016-10-27 01:59:36 +00:00
|
|
|
elif winsys == 'win32'
|
|
|
|
need_win_win32 = 'yes'
|
2019-05-21 06:14:39 +00:00
|
|
|
elif winsys == 'winrt'
|
|
|
|
need_win_winrt = 'yes'
|
2017-07-21 06:59:28 +00:00
|
|
|
elif winsys == 'cocoa'
|
|
|
|
need_win_cocoa = 'yes'
|
2019-12-16 18:49:09 +00:00
|
|
|
elif winsys == 'egl'
|
|
|
|
need_win_egl = 'yes'
|
2018-08-02 05:59:20 +00:00
|
|
|
elif winsys == 'eagl'
|
|
|
|
need_win_eagl = 'yes'
|
2016-10-19 05:11:58 +00:00
|
|
|
elif winsys == 'dispmanx'
|
|
|
|
need_win_dispmanx = 'yes'
|
2017-08-23 06:36:09 +00:00
|
|
|
elif winsys == 'viv-fb'
|
|
|
|
need_win_viv_fb = 'yes'
|
2018-02-23 21:39:32 +00:00
|
|
|
elif winsys == 'gbm'
|
2018-08-31 08:14:13 +00:00
|
|
|
need_win_gbm = 'yes'
|
2018-08-30 14:15:35 +00:00
|
|
|
elif winsys == 'android'
|
|
|
|
need_win_android = 'yes'
|
2016-09-09 01:08:53 +00:00
|
|
|
else
|
2016-10-18 03:10:32 +00:00
|
|
|
error('Unsupported GL winsys provided ' + winsys)
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
endif
|
|
|
|
|
|
|
|
gl_include_header = '''
|
|
|
|
#ifdef __GNUC__
|
|
|
|
# pragma GCC diagnostic push
|
|
|
|
# pragma GCC diagnostic ignored "-Wredundant-decls"
|
|
|
|
#endif
|
|
|
|
#ifndef GL_GLEXT_PROTOTYPES
|
|
|
|
#define GL_GLEXT_PROTOTYPES 1
|
|
|
|
#endif
|
|
|
|
'''
|
|
|
|
|
2018-06-18 12:24:13 +00:00
|
|
|
# convoluted way of getting at the subproject taking into account the wrap-mode
|
|
|
|
# so we don't download a subproject unless allowed
|
2018-10-28 13:47:04 +00:00
|
|
|
gl_header_dep = dependency('', fallback : ['gl-headers', 'gl_headers_dummy_dep'],
|
|
|
|
required : false)
|
2018-06-18 12:24:13 +00:00
|
|
|
if gl_header_dep.type_name() == 'internal'
|
|
|
|
# this will only contain the includes of headers that are not found
|
|
|
|
compat_includes = subproject('gl-headers').get_variable('compatibility_includes')
|
|
|
|
else
|
|
|
|
compat_includes = []
|
|
|
|
endif
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
# Desktop OpenGL checks
|
|
|
|
gl_dep = unneeded_dep
|
2016-09-09 13:24:01 +00:00
|
|
|
glx_dep = unneeded_dep
|
2021-05-14 12:10:55 +00:00
|
|
|
|
|
|
|
# (GLVND) OpenGL (without GLX) headers and interface
|
|
|
|
if need_api_opengl != 'no'
|
|
|
|
gl_dep = dependency('opengl', method: 'pkg-config', required : false)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# non-GLVND aka Legacy OpenGL
|
|
|
|
if need_api_opengl != 'no' and not gl_dep.found()
|
2018-08-02 05:59:20 +00:00
|
|
|
if host_system == 'darwin'
|
2018-12-14 03:02:36 +00:00
|
|
|
gl_dep = dependency('appleframeworks', modules : ['OpenGL'], required : false)
|
2017-07-21 06:59:28 +00:00
|
|
|
else
|
|
|
|
# override meson's braindead gl detection on osx/windows/etc by forcing pkg-config
|
|
|
|
gl_dep = dependency('gl', method: 'pkg-config', required : false)
|
|
|
|
endif
|
2018-06-06 07:24:26 +00:00
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
if not gl_dep.found()
|
2018-08-02 05:59:20 +00:00
|
|
|
if host_system == 'windows'
|
2016-10-27 01:59:36 +00:00
|
|
|
gl_dep = cc.find_library('opengl32', required : false)
|
|
|
|
else
|
2016-09-09 01:08:53 +00:00
|
|
|
gl_dep = cc.find_library('GL', required : false)
|
2016-10-27 01:59:36 +00:00
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2018-06-18 12:24:13 +00:00
|
|
|
if not cc.has_header('GL/gl.h', include_directories : compat_includes)
|
2017-08-23 06:23:07 +00:00
|
|
|
gl_dep = unneeded_dep
|
|
|
|
endif
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
if not gl_dep.found() and need_api_opengl == 'yes'
|
|
|
|
error ('Could not find requested OpenGL library')
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
|
|
|
|
if gl_dep.found()
|
|
|
|
gl_includes += [compat_includes]
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
2021-05-14 12:10:55 +00:00
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2021-05-14 12:10:55 +00:00
|
|
|
if need_platform_glx != 'no'
|
|
|
|
# (GLVND) GLX library and headers.
|
|
|
|
glx_dep = dependency('glx', method: 'pkg-config', required : false)
|
2018-11-28 09:46:05 +00:00
|
|
|
|
2021-05-14 12:10:55 +00:00
|
|
|
if not glx_dep.found()
|
|
|
|
if host_system == 'darwin'
|
|
|
|
glx_dep = cc.find_library('GL', required : false)
|
|
|
|
elif gl_dep.found()
|
|
|
|
glx_dep = gl_dep
|
|
|
|
elif need_platform_glx == 'yes'
|
|
|
|
error ('Could not find requested GLX library')
|
|
|
|
endif
|
2016-09-09 13:24:01 +00:00
|
|
|
endif
|
2021-05-14 12:10:55 +00:00
|
|
|
endif
|
2016-09-09 13:24:01 +00:00
|
|
|
|
2021-05-14 12:10:55 +00:00
|
|
|
if need_api_opengl != 'no'
|
2017-07-21 06:59:28 +00:00
|
|
|
opengl_includes = ''
|
2018-08-02 05:59:20 +00:00
|
|
|
if host_system == 'darwin'
|
2017-07-21 06:59:28 +00:00
|
|
|
opengl_includes += '''
|
2021-04-23 18:05:45 +00:00
|
|
|
#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
|
|
|
|
# define GL_SILENCE_DEPRECATION
|
|
|
|
#endif
|
2017-07-21 06:59:28 +00:00
|
|
|
#include <OpenGL/OpenGL.h>
|
|
|
|
#include <OpenGL/gl.h>
|
|
|
|
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
|
|
|
# define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
|
|
|
|
# include <OpenGL/gl3.h>
|
2016-09-09 01:08:53 +00:00
|
|
|
#endif
|
|
|
|
'''
|
2017-07-21 06:59:28 +00:00
|
|
|
else
|
|
|
|
opengl_includes += '''
|
|
|
|
#if _MSC_VER
|
|
|
|
# include <windows.h>
|
|
|
|
#endif
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#if __WIN32__ || _WIN32
|
|
|
|
# include <GL/glext.h>
|
|
|
|
#endif
|
|
|
|
'''
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
|
2020-10-28 12:26:27 +00:00
|
|
|
bcm_host_dep = unneeded_dep
|
|
|
|
if need_win_dispmanx != 'no'
|
|
|
|
|
|
|
|
# Try pkg-config for bcm_host then fallback to find_library to also
|
|
|
|
# support older distribution
|
|
|
|
bcm_host_dep = dependency('bcm_host', required : false)
|
|
|
|
if not bcm_host_dep.found()
|
|
|
|
bcm_host_dep = cc.find_library('bcm_host', required : false)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
# GLES2 checks
|
|
|
|
gles2_dep = unneeded_dep
|
2017-05-11 10:05:24 +00:00
|
|
|
gles3_h = false
|
|
|
|
gles3ext3_h = false
|
2016-09-09 01:08:53 +00:00
|
|
|
if need_api_gles2 != 'no'
|
2018-08-02 05:59:20 +00:00
|
|
|
if host_system == 'ios'
|
|
|
|
gles2_dep = dependency('appleframeworks', modules : ['OpenGLES'], required : false)
|
|
|
|
else
|
2020-10-28 12:26:27 +00:00
|
|
|
if bcm_host_dep.found()
|
|
|
|
gles2_dep = dependency('brcmglesv2', required : false)
|
|
|
|
endif
|
|
|
|
if not gles2_dep.found()
|
|
|
|
gles2_dep = dependency('glesv2', required : false)
|
|
|
|
endif
|
2018-08-02 05:59:20 +00:00
|
|
|
endif
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
if not gles2_dep.found()
|
2018-08-02 05:59:20 +00:00
|
|
|
# if host_system == 'windows'
|
|
|
|
# elif host_system == ios
|
2016-09-09 01:08:53 +00:00
|
|
|
# gles2_dep = cc.find_library('GLESv2', required : false)
|
|
|
|
# else
|
|
|
|
gles2_dep = cc.find_library('GLESv2', required : false)
|
|
|
|
# endif
|
|
|
|
|
2018-08-02 05:59:20 +00:00
|
|
|
if not cc.has_header('GLES2/gl2.h', include_directories : compat_includes)
|
|
|
|
gles2_dep = unneeded_dep
|
|
|
|
endif
|
2017-07-17 06:06:22 +00:00
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
if not gles2_dep.found() and need_api_gles2 == 'yes'
|
|
|
|
error ('Could not find requested OpenGL ES library')
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
|
|
|
|
if gles2_dep.found()
|
|
|
|
gl_includes += [compat_includes]
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
|
2018-06-18 12:24:13 +00:00
|
|
|
gles3_h = gles2_dep.found() and cc.has_header('GLES3/gl3.h', dependencies : gles2_dep, include_directories : compat_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2018-08-02 05:59:20 +00:00
|
|
|
gles_includes = ''
|
|
|
|
if host_system == 'ios'
|
|
|
|
gles_includes += '''
|
2016-09-09 01:08:53 +00:00
|
|
|
# include <OpenGLES/ES2/gl.h>
|
|
|
|
# include <OpenGLES/ES2/glext.h>
|
2018-08-02 05:59:20 +00:00
|
|
|
'''
|
|
|
|
else
|
|
|
|
if gles3_h
|
|
|
|
gl_includes += [compat_includes]
|
|
|
|
gles3ext3_h = gles3_h and cc.has_header('GLES3/gl3ext.h', dependencies : gles2_dep, include_directories : compat_includes)
|
|
|
|
gles_includes += '''
|
2016-09-09 01:08:53 +00:00
|
|
|
# include <GLES3/gl3.h>
|
2017-05-11 10:05:24 +00:00
|
|
|
# include <GLES2/gl2ext.h>'''
|
2018-08-02 05:59:20 +00:00
|
|
|
if gles3ext3_h
|
|
|
|
gles_includes += '''
|
2016-09-09 01:08:53 +00:00
|
|
|
# include <GLES3/gl3ext.h>'''
|
2018-08-02 05:59:20 +00:00
|
|
|
endif
|
|
|
|
else
|
|
|
|
gles_includes += '''
|
2016-09-09 01:08:53 +00:00
|
|
|
# include <GLES2/gl2.h>
|
|
|
|
# include <GLES2/gl2ext.h>'''
|
2018-08-02 05:59:20 +00:00
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# can we include both gles2 and opengl headers?
|
|
|
|
if gles2_dep.found() and gl_dep.found()
|
|
|
|
gl_include_block = gl_include_header + gles_includes + opengl_includes
|
2018-01-16 11:25:29 +00:00
|
|
|
# TODO: Revert to passing gl_include_block via prefix: once
|
|
|
|
# https://github.com/mesonbuild/meson/issues/2364 is fixed
|
2018-06-18 12:24:13 +00:00
|
|
|
if not cc.compiles(gl_include_block + '\n' + 'void f (void) {}',dependencies : [gles2_dep, gl_dep], include_directories : compat_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
message ('Cannot include both OpenGL and OpenGL ES headers')
|
2018-02-05 03:56:07 +00:00
|
|
|
if need_api_gles2 != 'yes'
|
2016-09-09 01:08:53 +00:00
|
|
|
gles2_dep = unneeded_dep
|
2018-02-05 03:56:07 +00:00
|
|
|
elif need_api_opengl != 'yes'
|
2016-09-09 01:08:53 +00:00
|
|
|
gl_dep = unneeded_dep
|
|
|
|
else
|
|
|
|
error('Both OpenGL and OpenGL ES were requested but cannot be included together')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
gl_include_block = gl_include_header
|
|
|
|
if gles2_dep.found()
|
|
|
|
gl_include_block += gles_includes
|
|
|
|
endif
|
|
|
|
if gl_dep.found()
|
|
|
|
gl_include_block += opengl_includes
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gles2_dep.found()
|
|
|
|
gl_lib_deps += gles2_dep
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLES2', 1)
|
2016-09-09 01:08:53 +00:00
|
|
|
if gles3_h
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLES3',1)
|
2017-05-11 10:05:24 +00:00
|
|
|
if gles3ext3_h
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLES3EXT3_H', 1)
|
2017-05-11 10:05:24 +00:00
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
enabled_gl_apis += 'gles2'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if gl_dep.found()
|
|
|
|
gl_lib_deps += gl_dep
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_OPENGL', 1)
|
2019-01-22 13:24:29 +00:00
|
|
|
enabled_gl_apis += 'gl'
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# EGL checks
|
|
|
|
egl_dep = unneeded_dep
|
|
|
|
if need_platform_egl != 'no'
|
2020-10-28 12:26:27 +00:00
|
|
|
if bcm_host_dep.found()
|
|
|
|
egl_dep = dependency('brcmegl', required : false)
|
|
|
|
endif
|
|
|
|
if not egl_dep.found()
|
|
|
|
egl_dep = dependency('egl', required : false)
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
if not egl_dep.found()
|
|
|
|
egl_dep = cc.find_library('EGL', required : false)
|
2018-09-05 08:34:06 +00:00
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2018-09-05 08:34:06 +00:00
|
|
|
if egl_dep.found() and not cc.has_header('EGL/egl.h',
|
|
|
|
dependencies : egl_dep,
|
|
|
|
include_directories : compat_includes)
|
|
|
|
egl_dep = unneeded_dep
|
|
|
|
endif
|
|
|
|
if egl_dep.found() and not cc.has_header('EGL/eglext.h',
|
|
|
|
dependencies : egl_dep,
|
|
|
|
include_directories : compat_includes)
|
|
|
|
egl_dep = unneeded_dep
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if egl_dep.found()
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_egl_sources += files([
|
2016-11-17 03:32:10 +00:00
|
|
|
'egl/gstegl.c',
|
2016-09-09 01:08:53 +00:00
|
|
|
'egl/gsteglimage.c',
|
|
|
|
'egl/gstglcontext_egl.c',
|
|
|
|
'egl/gstgldisplay_egl.c',
|
|
|
|
'egl/gstglmemoryegl.c',
|
2019-04-04 08:41:13 +00:00
|
|
|
'egl/gstgldisplay_egl_device.c',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
|
|
|
gl_egl_headers += files([
|
2021-10-22 06:54:55 +00:00
|
|
|
'egl/egl.h',
|
2016-09-09 01:08:53 +00:00
|
|
|
'egl/gstegl.h',
|
|
|
|
'egl/gsteglimage.h',
|
|
|
|
'egl/gstgldisplay_egl.h',
|
|
|
|
'egl/gstglmemoryegl.h',
|
2019-04-04 08:41:13 +00:00
|
|
|
'egl/gstgldisplay_egl_device.h',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2016-09-09 01:08:53 +00:00
|
|
|
gl_platform_deps += egl_dep
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_PLATFORM_EGL', 1)
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2018-04-20 10:42:16 +00:00
|
|
|
if cc.has_header('libdrm/drm_fourcc.h')
|
2017-12-10 20:02:26 +00:00
|
|
|
gl_misc_deps += allocators_dep
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_DMABUF', 1)
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
egl_includes = '''
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
#include <EGL/eglext.h>
|
|
|
|
'''
|
2016-10-27 01:59:36 +00:00
|
|
|
enabled_gl_platforms += 'egl'
|
2018-09-05 08:34:06 +00:00
|
|
|
elif need_platform_egl == 'yes'
|
|
|
|
error ('Could not find requested EGL library')
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-12-16 18:49:09 +00:00
|
|
|
# winsys_egl checks
|
|
|
|
if need_win_egl == 'yes'
|
|
|
|
if need_platform_egl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use Winsys egl without EGL support')
|
|
|
|
elif not egl_dep.found()
|
|
|
|
error ('Could not find EGL libraries for Winsys egl')
|
|
|
|
else
|
|
|
|
enabled_gl_winsys += 'egl'
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
# wayland checks
|
|
|
|
wayland_client_dep = unneeded_dep
|
|
|
|
wayland_cursor_dep = unneeded_dep
|
|
|
|
wayland_egl_dep = unneeded_dep
|
|
|
|
if need_win_wayland != 'no'
|
|
|
|
if need_win_wayland == 'yes'
|
|
|
|
if need_platform_egl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use Wayland without EGL support')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
if not egl_dep.found()
|
|
|
|
if need_win_wayland == 'yes'
|
|
|
|
error ('Could not find EGL libraries for wayland')
|
|
|
|
else
|
|
|
|
message ('Could not find EGL libraries for wayland')
|
|
|
|
endif
|
|
|
|
else
|
2020-03-03 00:53:53 +00:00
|
|
|
wayland_client_dep = dependency('wayland-client', version : '>= 1.11', required : false)
|
2016-09-09 01:08:53 +00:00
|
|
|
wayland_cursor_dep = dependency('wayland-cursor', version : '>= 1.0', required : false)
|
|
|
|
wayland_egl_dep = dependency('wayland-egl', version : '>= 1.0', required : false)
|
2018-12-14 15:33:50 +00:00
|
|
|
wayland_protocols_dep = dependency('wayland-protocols', version : '>= 1.15', required : false)
|
|
|
|
wayland_scanner = find_program('wayland-scanner', required: false)
|
|
|
|
|
|
|
|
if wayland_client_dep.found() and wayland_cursor_dep.found() and wayland_egl_dep.found() and wayland_protocols_dep.found() and wayland_scanner.found()
|
|
|
|
# Generate the XDG shell interface
|
2021-10-17 23:40:14 +00:00
|
|
|
wayland_protocols_basedir = wayland_protocols_dep.get_variable('pkgdatadir')
|
2018-12-14 15:33:50 +00:00
|
|
|
xdg_shell_xml_spec = join_paths(wayland_protocols_basedir, 'stable', 'xdg-shell', 'xdg-shell.xml')
|
|
|
|
xdg_shell_header = custom_target('xdg-shell-client-header',
|
|
|
|
command: [ wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@' ],
|
|
|
|
input: xdg_shell_xml_spec,
|
|
|
|
output: 'xdg-shell-client-protocol.h',
|
|
|
|
)
|
|
|
|
xdg_shell_code = custom_target('xdg-shell-client-code',
|
|
|
|
command: [ wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@' ],
|
|
|
|
input: xdg_shell_xml_spec,
|
|
|
|
output: 'xdg-shell-client-protocol.c',
|
|
|
|
)
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_wayland_sources += files([
|
2016-09-09 01:08:53 +00:00
|
|
|
'wayland/gstgldisplay_wayland.c',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2020-07-23 09:48:55 +00:00
|
|
|
'wayland/gstglwindow_wayland_egl.c',
|
|
|
|
'wayland/wayland_event_source.c',
|
2018-12-14 15:33:50 +00:00
|
|
|
xdg_shell_header,
|
|
|
|
xdg_shell_code,
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_wayland_headers += files([
|
2020-08-11 06:53:51 +00:00
|
|
|
'wayland/wayland.h',
|
2016-11-07 15:47:36 +00:00
|
|
|
'wayland/gstgldisplay_wayland.h'
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_WAYLAND', 1)
|
|
|
|
gl_winsys_deps += [wayland_client_dep, wayland_cursor_dep, wayland_egl_dep]
|
|
|
|
enabled_gl_winsys += 'wayland'
|
|
|
|
else
|
|
|
|
if need_win_wayland == 'yes'
|
|
|
|
error ('Could not find requested Wayland libraries')
|
|
|
|
endif
|
|
|
|
wayland_client_dep = unneeded_dep
|
|
|
|
wayland_cursor_dep = unneeded_dep
|
|
|
|
wayland_egl_dep = unneeded_dep
|
2018-12-14 15:33:50 +00:00
|
|
|
wayland_protocols_dep = unneeded_dep
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# X11 checks
|
|
|
|
if need_platform_glx == 'yes'
|
|
|
|
if need_win_x11 == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use GLX without X11 support')
|
|
|
|
elif need_api_opengl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use GLX without the OpenGL library')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2022-03-29 15:51:13 +00:00
|
|
|
xcb_dep = unneeded_dep
|
2016-09-09 01:08:53 +00:00
|
|
|
if need_win_x11 != 'no'
|
2016-11-11 01:05:55 +00:00
|
|
|
xcb_dep = dependency('x11-xcb', required : false)
|
2016-11-08 12:20:51 +00:00
|
|
|
if x11_dep.found() and xcb_dep.found()
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_x11_sources += files([
|
2016-09-09 01:08:53 +00:00
|
|
|
'x11/gstgldisplay_x11.c',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2016-09-09 01:08:53 +00:00
|
|
|
'x11/gstglwindow_x11.c',
|
2016-11-08 08:52:48 +00:00
|
|
|
'x11/xcb_event_source.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2020-06-27 04:37:39 +00:00
|
|
|
gl_x11_headers += files([
|
2020-08-11 06:53:51 +00:00
|
|
|
'x11/x11.h',
|
2016-09-09 01:08:53 +00:00
|
|
|
'x11/gstgldisplay_x11.h',
|
2020-06-27 04:37:39 +00:00
|
|
|
])
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_X11', 1)
|
2016-11-08 12:20:51 +00:00
|
|
|
gl_winsys_deps += [x11_dep, xcb_dep]
|
2016-09-09 01:08:53 +00:00
|
|
|
enabled_gl_winsys += 'x11'
|
|
|
|
|
2018-11-28 09:46:05 +00:00
|
|
|
if need_platform_glx != 'no' and glx_dep.found() and cc.has_function ('glXMakeCurrent', dependencies : glx_dep)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_PLATFORM_GLX', 1)
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2016-09-09 01:08:53 +00:00
|
|
|
'x11/gstglcontext_glx.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2016-09-09 01:08:53 +00:00
|
|
|
# GLX is in the opengl library on linux
|
2016-09-09 13:24:01 +00:00
|
|
|
gl_platform_deps += glx_dep
|
2016-09-09 01:08:53 +00:00
|
|
|
enabled_gl_platforms += 'glx'
|
|
|
|
endif
|
|
|
|
elif need_win_x11 == 'yes'
|
|
|
|
error ('Could not find requested X11 libraries')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-10-19 05:11:58 +00:00
|
|
|
if need_win_dispmanx != 'no'
|
2022-10-04 04:39:51 +00:00
|
|
|
have_dispmanx_window_t = cc.has_type(
|
|
|
|
'EGL_DISPMANX_WINDOW_T',
|
|
|
|
prefix: '''
|
|
|
|
#include <bcm_host.h>
|
|
|
|
#include <EGL/egl.h>
|
|
|
|
''',
|
|
|
|
dependencies: [gl_lib_deps, egl_dep, bcm_host_dep],
|
|
|
|
include_directories: gl_includes)
|
|
|
|
|
|
|
|
if have_dispmanx_window_t and bcm_host_dep.found()
|
2016-10-19 05:11:58 +00:00
|
|
|
if not egl_dep.found()
|
|
|
|
error('dispmanx requires the use of egl')
|
|
|
|
endif
|
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2016-10-19 05:11:58 +00:00
|
|
|
'dispmanx/gstglwindow_dispmanx_egl.c'
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2016-10-19 05:11:58 +00:00
|
|
|
|
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_DISPMANX', 1)
|
|
|
|
gl_winsys_deps += bcm_host_dep
|
|
|
|
enabled_gl_winsys += 'dispmanx'
|
|
|
|
gl_cpp_args += ['-DUSE_EGL_RPI']
|
|
|
|
elif need_win_dispmanx == 'yes'
|
|
|
|
error('Could not find dispmanx libraries')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
# win32 checks
|
|
|
|
if need_platform_wgl == 'yes'
|
|
|
|
if need_win_win32 == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use WGL without the win32 window system')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-02-18 11:36:38 +00:00
|
|
|
if host_system == 'windows' and need_win_win32 != 'no'
|
2016-10-27 01:59:36 +00:00
|
|
|
gdi_dep = cc.find_library('gdi32', required : false)
|
2020-02-18 11:36:38 +00:00
|
|
|
if gdi_dep.found()
|
|
|
|
have_wgl = false
|
|
|
|
have_egl_win32 = false
|
|
|
|
if need_platform_wgl != 'no'
|
|
|
|
wglext_h = cc.has_header('GL/wglext.h',
|
|
|
|
prefix : '''#include <windows.h>
|
|
|
|
#include <GL/gl.h>''',
|
|
|
|
include_directories : compat_includes)
|
|
|
|
have_wgl = wglext_h and gl_dep.found()
|
|
|
|
endif
|
|
|
|
|
|
|
|
have_egl_win32 = enabled_gl_platforms.contains('egl') and gles2_dep.found()
|
|
|
|
if have_wgl or have_egl_win32
|
|
|
|
gl_includes += [compat_includes]
|
|
|
|
gl_platform_deps += gdi_dep
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2020-02-18 11:36:38 +00:00
|
|
|
'win32/gstglwindow_win32.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2020-02-18 11:36:38 +00:00
|
|
|
enabled_gl_winsys += 'win32'
|
|
|
|
gl_winsys_deps += gdi_dep
|
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_WIN32', 1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
if have_wgl
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2020-02-18 11:36:38 +00:00
|
|
|
'wgl/gstglcontext_wgl.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2020-02-18 11:36:38 +00:00
|
|
|
enabled_gl_platforms += 'wgl'
|
|
|
|
glconf.set('GST_GL_HAVE_PLATFORM_WGL', 1)
|
|
|
|
endif
|
2016-10-27 01:59:36 +00:00
|
|
|
endif
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2019-05-21 06:14:39 +00:00
|
|
|
# WinRT ANGLE checks
|
|
|
|
if need_win_winrt != 'no' and host_system == 'windows'
|
|
|
|
if need_win_winrt == 'yes' and not enabled_gl_platforms.contains('egl')
|
|
|
|
error('Impossible situation requested: Cannot use WinRT ANGLE without EGL support')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if egl_dep.found()
|
|
|
|
windows_graphics_h = cc.has_header('windows.graphics.h')
|
|
|
|
windows_app_dep = cc.find_library('WindowsApp', required: false)
|
2020-07-09 13:23:33 +00:00
|
|
|
runtimeobject_lib = cc.find_library('runtimeobject', required: false)
|
2019-05-21 06:14:39 +00:00
|
|
|
|
2020-07-09 13:23:33 +00:00
|
|
|
if windows_graphics_h and windows_app_dep.found() and runtimeobject_lib.found()
|
2019-05-21 06:14:39 +00:00
|
|
|
enabled_gl_winsys += 'winrt'
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_WINRT', 1)
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2020-07-09 10:51:57 +00:00
|
|
|
'winrt/gstglwindow_winrt_egl.cpp'
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2020-07-09 13:23:33 +00:00
|
|
|
gl_winsys_deps += runtimeobject_lib
|
2019-05-21 06:14:39 +00:00
|
|
|
elif need_win_winrt == 'yes'
|
|
|
|
error('WinRT is enabled, but headers/libraries were not found')
|
|
|
|
endif
|
|
|
|
elif need_win_winrt == 'yes'
|
|
|
|
error('WinRT ANGLE is enabled, but EGL was not found')
|
|
|
|
else
|
|
|
|
message('WinRT ANGLE disabled because EGL was not found')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-08-16 21:29:14 +00:00
|
|
|
if ['darwin', 'ios'].contains(host_system)
|
2017-07-21 06:59:28 +00:00
|
|
|
if not have_objc
|
|
|
|
error('No ObjC compiler found')
|
|
|
|
endif
|
|
|
|
|
|
|
|
objc = meson.get_compiler('objc')
|
|
|
|
if not objc.has_argument('-fobjc-arc')
|
|
|
|
error('ARC is required for building')
|
|
|
|
endif
|
|
|
|
|
|
|
|
gl_objc_args += ['-fobjc-arc']
|
2018-08-02 05:59:20 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# OSX check
|
|
|
|
if need_platform_cgl == 'yes'
|
|
|
|
if need_win_cocoa == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use CGL without Cocoa support')
|
|
|
|
elif need_api_opengl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use CGL without the OpenGL library')
|
|
|
|
endif
|
|
|
|
elif need_platform_cgl == 'no' and need_win_cocoa == 'yes'
|
|
|
|
error('Impossible situation requested: Cannot use Cocoa without CGL support')
|
|
|
|
endif
|
2017-07-21 06:59:28 +00:00
|
|
|
|
2018-08-02 05:59:20 +00:00
|
|
|
if host_system == 'darwin'
|
|
|
|
foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : false)
|
|
|
|
quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : false)
|
|
|
|
corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : false)
|
2017-07-21 06:59:28 +00:00
|
|
|
|
2018-08-03 09:06:00 +00:00
|
|
|
if need_platform_cgl != 'no'
|
2018-08-02 05:59:20 +00:00
|
|
|
if foundation_dep.found() and quartzcore_dep.found() and corefoundation_dep.found()
|
|
|
|
gl_platform_deps += [quartzcore_dep, corefoundation_dep, foundation_dep]
|
2018-08-03 09:06:00 +00:00
|
|
|
enabled_gl_platforms += 'cgl'
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_PLATFORM_CGL', 1)
|
2018-08-03 09:06:00 +00:00
|
|
|
|
|
|
|
if need_win_cocoa != 'no'
|
2018-08-02 05:59:20 +00:00
|
|
|
cocoa_dep = dependency('appleframeworks', modules : ['Cocoa'], required : false)
|
2018-08-03 09:06:00 +00:00
|
|
|
if cocoa_dep.found()
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2018-08-03 09:06:00 +00:00
|
|
|
'cocoa/gstglcaopengllayer.m',
|
|
|
|
'cocoa/gstglcontext_cocoa.m',
|
|
|
|
'cocoa/gstgldisplay_cocoa.m',
|
|
|
|
'cocoa/gstglwindow_cocoa.m'
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2018-08-03 09:06:00 +00:00
|
|
|
gl_winsys_deps += cocoa_dep
|
|
|
|
enabled_gl_winsys += 'cocoa'
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_COCOA', 1)
|
2018-08-03 09:06:00 +00:00
|
|
|
elif need_win_cocoa == 'yes'
|
|
|
|
error('Could not find Cocoa')
|
|
|
|
endif
|
2017-07-21 06:59:28 +00:00
|
|
|
endif
|
2018-08-03 09:06:00 +00:00
|
|
|
elif need_platform_cgl == 'yes'
|
|
|
|
error('Could not find CGL dependencies')
|
2017-07-21 06:59:28 +00:00
|
|
|
endif
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|
|
|
|
|
2018-08-02 05:59:20 +00:00
|
|
|
if need_platform_eagl == 'yes'
|
|
|
|
if host_system != 'ios'
|
|
|
|
error('Can only use EAGL on iOS')
|
|
|
|
endif
|
|
|
|
if need_win_eagl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use EAGL platform without the EAGL window system')
|
|
|
|
elif need_api_gles == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use EAGL platform without the GLES library')
|
|
|
|
endif
|
|
|
|
elif need_platform_eagl == 'no' and need_win_eagl == 'yes'
|
|
|
|
error('Impossible situation requested: Cannot use EAGL window system without the EAGL platform')
|
|
|
|
endif
|
|
|
|
|
|
|
|
if host_system == 'ios' and need_platform_eagl != 'no' and need_win_eagl != 'no'
|
|
|
|
foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : false)
|
|
|
|
corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : false)
|
|
|
|
coregraphics_dep = dependency('appleframeworks', modules : ['CoreGraphics'], required : false)
|
2020-05-29 05:44:55 +00:00
|
|
|
quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : false)
|
2018-08-02 05:59:20 +00:00
|
|
|
uikit_dep = dependency('appleframeworks', modules : ['UIkit'], required : false)
|
|
|
|
|
2020-05-29 05:44:55 +00:00
|
|
|
if foundation_dep.found() and corefoundation_dep.found() and coregraphics_dep.found() and quartzcore_dep.found() and uikit_dep.found()
|
2018-08-02 05:59:20 +00:00
|
|
|
gl_platform_deps += [
|
|
|
|
corefoundation_dep,
|
|
|
|
foundation_dep,
|
|
|
|
coregraphics_dep,
|
2020-05-29 05:44:55 +00:00
|
|
|
quartzcore_dep,
|
2018-08-02 05:59:20 +00:00
|
|
|
uikit_dep,
|
|
|
|
]
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2018-08-02 05:59:20 +00:00
|
|
|
'eagl/gstglcontext_eagl.m',
|
|
|
|
'eagl/gstglwindow_eagl.m',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2018-08-02 05:59:20 +00:00
|
|
|
enabled_gl_winsys += 'eagl'
|
|
|
|
enabled_gl_platforms += 'eagl'
|
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_EAGL', 1)
|
|
|
|
glconf.set('GST_GL_HAVE_PLATFORM_EAGL', 1)
|
|
|
|
elif need_platform_eagl == 'yes' or need_win_eagl == 'yes'
|
|
|
|
error('Could not find dependencies for EAGL')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-08-31 08:14:13 +00:00
|
|
|
# GBM Checks
|
2018-02-23 21:39:32 +00:00
|
|
|
gbm_gudev_dep = unneeded_dep
|
|
|
|
gbm_libdrm_dep = unneeded_dep
|
|
|
|
gbm_dep = unneeded_dep
|
|
|
|
if need_win_gbm != 'no'
|
|
|
|
if need_win_gbm == 'yes'
|
|
|
|
if need_platform_egl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot use GBM without EGL support')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
gbm_gudev_dep = dependency('gudev-1.0', version : '>=147', required : false)
|
|
|
|
gbm_libdrm_dep = dependency('libdrm', version : '>= 2.4.55', required : false)
|
|
|
|
gbm_dep = dependency('gbm', required : false)
|
|
|
|
if egl_dep.found() and gbm_gudev_dep.found() and gbm_libdrm_dep.found() and gbm_dep.found()
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2018-02-23 21:39:32 +00:00
|
|
|
'gbm/gstgldisplay_gbm.c',
|
|
|
|
'gbm/gstgl_gbm_utils.c',
|
|
|
|
'gbm/gstglwindow_gbm_egl.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2018-02-23 21:39:32 +00:00
|
|
|
enabled_gl_winsys += 'gbm'
|
|
|
|
gl_winsys_deps += [gbm_gudev_dep, gbm_libdrm_dep, gbm_dep]
|
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_GBM', 1)
|
|
|
|
else
|
|
|
|
if need_win_gbm == 'yes'
|
|
|
|
error ('Could not find requested GBM libraries')
|
|
|
|
endif
|
|
|
|
gbm_gudev_dep = unneeded_dep
|
|
|
|
gbm_libdrm_dep = unneeded_dep
|
|
|
|
gbm_dep = unneeded_dep
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-08-23 06:36:09 +00:00
|
|
|
if need_platform_egl != 'no' and need_win_viv_fb != 'no'
|
|
|
|
if egl_dep.found() and cc.has_function ('fbGetDisplay', dependencies : egl_dep)
|
|
|
|
if cc.has_function ('glTexDirectVIV', dependencies : gles2_dep)
|
|
|
|
enabled_gl_winsys += 'viv-fb'
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_VIV_FB', 1)
|
|
|
|
glconf.set('GST_GL_HAVE_VIV_DIRECTVIV', 1)
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2017-08-23 06:36:09 +00:00
|
|
|
'viv-fb/gstgldisplay_viv_fb.c',
|
|
|
|
'viv-fb/gstglwindow_viv_fb_egl.c',
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2017-08-23 06:36:09 +00:00
|
|
|
gl_cpp_args += ['-DEGL_API_FB']
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2018-08-30 14:15:35 +00:00
|
|
|
if need_win_android == 'yes'
|
|
|
|
if need_platform_egl == 'no'
|
|
|
|
error('Impossible situation requested: Cannot build for Android without EGL')
|
|
|
|
elif need_api_gles2 == 'no'
|
|
|
|
error('Impossible situation requested: Cannot build for Android without GLES2 support')
|
|
|
|
elif host_system != 'android'
|
|
|
|
error('Impossible situation requested: Cannot build for Android without an android system')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
if host_system == 'android' and need_win_android != 'no' and need_platform_egl != 'no'
|
|
|
|
if gles2_dep.found() and egl_dep.found()
|
|
|
|
enabled_gl_winsys += ['android']
|
2022-03-07 13:46:57 +00:00
|
|
|
glconf.set('GST_GL_HAVE_WINDOW_ANDROID', 1)
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_priv_sources += [
|
2018-08-30 14:15:35 +00:00
|
|
|
'android/gstglwindow_android_egl.c'
|
2020-06-27 04:39:00 +00:00
|
|
|
]
|
2018-08-30 14:15:35 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-03-17 02:56:16 +00:00
|
|
|
gl_nvmm = false
|
|
|
|
nvbuf_utils_dep = unneeded_dep
|
2021-02-26 07:48:09 +00:00
|
|
|
if egl_dep.found()
|
|
|
|
# XXX: provide options for this?
|
|
|
|
# c_args and c_link_args can also cover this case just fine e.g.:
|
|
|
|
# -Dc_args='-I/usr/src/jetson_multimedia_api/include' -Dc_link_args='-L/usr/lib/aarch64-linux-gnu/tegra/'
|
|
|
|
nvbuf_utils_dep = cc.find_library('nvbuf_utils', required : false)
|
|
|
|
nvbuf_utils_h = cc.has_header('nvbuf_utils.h')
|
|
|
|
if nvbuf_utils_dep.found() and nvbuf_utils_h
|
|
|
|
gl_misc_deps += [nvbuf_utils_dep]
|
2021-03-17 02:56:16 +00:00
|
|
|
gl_nvmm = true
|
2021-02-26 07:48:09 +00:00
|
|
|
gl_cpp_args += ['-DHAVE_NVMM']
|
|
|
|
endif
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
|
|
|
|
build_gstgl = true
|
2017-08-23 06:32:57 +00:00
|
|
|
if enabled_gl_apis.length() == 0
|
2016-09-09 01:08:53 +00:00
|
|
|
message('No OpenGL API libraries found or requested')
|
|
|
|
build_gstgl = false
|
|
|
|
endif
|
2017-08-23 06:32:57 +00:00
|
|
|
if enabled_gl_platforms.length() == 0
|
2016-09-09 01:08:53 +00:00
|
|
|
message('No OpenGL Platforms found or requested')
|
|
|
|
build_gstgl = false
|
|
|
|
endif
|
2017-08-23 06:32:57 +00:00
|
|
|
if enabled_gl_winsys.length() == 0
|
2016-09-09 01:08:53 +00:00
|
|
|
message('No OpenGL Window systems found or requested')
|
|
|
|
build_gstgl = false
|
|
|
|
endif
|
|
|
|
|
|
|
|
if build_gstgl
|
|
|
|
# find some types that may or may not be defined
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLeglImageOES', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLEGLIMAGEOES', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLchar', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLCHAR', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLsizeiptr', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLSIZEIPTR', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLintptr', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLINTPTR', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLsync', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLSYNC', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLuint64', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLUINT64', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
if cc.has_type('GLint64', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_GLINT64', 1)
|
|
|
|
endif
|
2018-06-18 12:24:13 +00:00
|
|
|
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)
|
2016-09-09 01:08:53 +00:00
|
|
|
glconf.set('GST_GL_HAVE_EGLATTRIB', 1)
|
|
|
|
endif
|
2018-07-16 14:01:34 +00:00
|
|
|
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)
|
|
|
|
glconf.set('GST_GL_HAVE_EGLUINT64KHR', 1)
|
|
|
|
endif
|
2016-09-09 01:08:53 +00:00
|
|
|
|
2020-09-25 18:05:09 +00:00
|
|
|
summary('GL api', enabled_gl_apis, list_sep: ', ')
|
|
|
|
summary('GL platform', enabled_gl_platforms, list_sep: ', ')
|
|
|
|
summary('GL winsys', enabled_gl_winsys, list_sep: ', ')
|
2016-09-09 01:08:53 +00:00
|
|
|
|
|
|
|
install_headers(gl_headers, subdir : 'gstreamer-1.0/gst/gl')
|
|
|
|
install_headers(gl_prototype_headers, subdir : 'gstreamer-1.0/gst/gl/glprototypes')
|
|
|
|
|
|
|
|
configure_file(input : 'gstglconfig.h.meson',
|
|
|
|
output : 'gstglconfig.h',
|
|
|
|
install_dir : get_option('libdir') + '/gstreamer-1.0/include/gst/gl',
|
2022-03-11 23:08:14 +00:00
|
|
|
install_tag : 'devel',
|
2016-09-09 01:08:53 +00:00
|
|
|
configuration : glconf)
|
|
|
|
|
2020-08-26 09:15:19 +00:00
|
|
|
glib_mkenums = find_program('glib-mkenums')
|
|
|
|
mkenums = find_program('gl_mkenum.py')
|
|
|
|
gl_enumtypes_h = custom_target('gstglenumtypes_h',
|
|
|
|
output : 'gl-enumtypes.h',
|
|
|
|
input : gir_gl_headers,
|
|
|
|
install : true,
|
|
|
|
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/gl/'),
|
|
|
|
command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
|
|
|
|
|
|
|
|
gl_enumtypes_c = custom_target('gstglenumtypes_c',
|
|
|
|
output : 'gl-enumtypes.c',
|
|
|
|
input : gir_gl_headers,
|
|
|
|
depends : [gl_enumtypes_h],
|
|
|
|
command : [mkenums, glib_mkenums, '@OUTPUT@', '@INPUT@'])
|
2018-10-03 10:06:42 +00:00
|
|
|
gen_sources = [gl_enumtypes_h]
|
|
|
|
|
2021-10-01 14:30:27 +00:00
|
|
|
common_args = gst_plugins_base_args + gl_cpp_args + ['-DBUILDING_GST_GL', '-DG_LOG_DOMAIN="GStreamer-GL"']
|
2021-04-26 18:25:03 +00:00
|
|
|
|
|
|
|
# We have custom_target() that generate headers in the current build dir,
|
|
|
|
# but with implicit_include_directories: false, meson >= 0.58.0 won't include
|
|
|
|
# it by default. We cannot use include_directories('.') here because it would
|
|
|
|
# also include current source dir which is what we want to avoid because
|
|
|
|
# case-insensitive FS would include gst-libs/gl/egl/egl.h as EGL/egl.h.
|
|
|
|
common_args += '-I@0@'.format(meson.current_build_dir())
|
|
|
|
|
2016-09-09 01:08:53 +00:00
|
|
|
gstgl = library('gstgl-' + api_version,
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_sources, gl_egl_sources, gl_x11_sources, gl_wayland_sources, gl_priv_sources, gl_enumtypes_c, gl_enumtypes_h,
|
2021-04-26 18:25:03 +00:00
|
|
|
c_args : common_args,
|
|
|
|
cpp_args : common_args,
|
|
|
|
objc_args : common_args + gl_objc_args,
|
2018-06-18 12:24:13 +00:00
|
|
|
include_directories : [configinc, libsinc, gl_includes],
|
2016-09-09 01:08:53 +00:00
|
|
|
version : libversion,
|
|
|
|
soversion : soversion,
|
2020-07-23 09:48:55 +00:00
|
|
|
darwin_versions : osxversion,
|
2016-09-09 01:08:53 +00:00
|
|
|
install : true,
|
2017-12-10 20:02:26 +00:00
|
|
|
dependencies : [gst_base_dep, video_dep, allocators_dep, gmodule_dep,
|
2020-08-26 09:15:19 +00:00
|
|
|
gl_lib_deps, gl_platform_deps, gl_winsys_deps, gl_misc_deps],
|
|
|
|
# don't confuse EGL/egl.h with gst-libs/gl/egl/egl.h on case-insensitive file systems
|
2020-09-08 10:11:55 +00:00
|
|
|
implicit_include_directories : false)
|
2020-07-23 09:48:55 +00:00
|
|
|
|
2021-05-17 10:10:49 +00:00
|
|
|
pkgconfig_gl_variables = [
|
|
|
|
'gl_platforms=' + ' '.join(enabled_gl_platforms),
|
|
|
|
'gl_winsys=' + ' '.join(enabled_gl_winsys),
|
|
|
|
'gl_apis=' + ' '.join(enabled_gl_apis),
|
|
|
|
]
|
|
|
|
|
2022-08-29 14:20:55 +00:00
|
|
|
library_def = {'lib': gstgl}
|
2020-06-27 04:39:00 +00:00
|
|
|
pkg_name = 'gstreamer-gl-1.0'
|
2018-04-08 00:52:12 +00:00
|
|
|
pkgconfig.generate(gstgl,
|
|
|
|
libraries : [gstvideo, gst_base_dep, gst_dep],
|
2021-05-17 10:10:49 +00:00
|
|
|
variables : pkgconfig_variables + pkgconfig_gl_variables,
|
|
|
|
uninstalled_variables : pkgconfig_gl_variables,
|
2018-04-08 00:52:12 +00:00
|
|
|
subdirs : pkgconfig_subdirs,
|
|
|
|
extra_cflags : ['-I${libdir}/gstreamer-1.0/include'],
|
2020-06-27 04:39:00 +00:00
|
|
|
name : pkg_name,
|
2018-04-08 00:52:12 +00:00
|
|
|
description : 'Streaming media framework, OpenGL plugins libraries',
|
|
|
|
)
|
|
|
|
|
2021-05-16 23:33:44 +00:00
|
|
|
# Desperate times, desperate measures... fix up escaping of our variables
|
|
|
|
run_command(meson_pkg_config_file_fixup_script,
|
|
|
|
'gstreamer-gl-1.0', 'gl_platforms', 'gl_winsys', 'gl_apis',
|
|
|
|
check: true)
|
|
|
|
|
2021-04-07 12:28:40 +00:00
|
|
|
pkgconfig.generate(
|
|
|
|
libraries : [gstgl, gl_lib_deps],
|
2018-04-08 00:52:12 +00:00
|
|
|
subdirs : pkgconfig_subdirs,
|
|
|
|
name : 'gstreamer-gl-prototypes-1.0',
|
|
|
|
description : 'Streaming media framework, OpenGL plugins libraries (OpenGL Prototypes)',
|
|
|
|
)
|
|
|
|
|
2017-01-23 15:12:06 +00:00
|
|
|
if build_gir
|
2020-06-27 04:39:00 +00:00
|
|
|
gir = {
|
|
|
|
'sources' : gl_sources + [gl_enumtypes_h] + [gl_enumtypes_c] + gir_gl_headers,
|
|
|
|
'namespace' : 'GstGL',
|
|
|
|
'nsversion' : api_version,
|
|
|
|
'identifier_prefix' : 'Gst',
|
|
|
|
'symbol_prefix' : 'gst',
|
|
|
|
'export_packages' : pkg_name,
|
|
|
|
'includes' : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
|
|
|
|
'install' : true,
|
|
|
|
'extra_args' : gir_init_section + ['--c-include=gst/gl/gl.h'],
|
|
|
|
'dependencies' : [video_dep, gst_dep, gst_base_dep],
|
|
|
|
}
|
|
|
|
library_def += {'gir': [gir]}
|
|
|
|
if not static_build
|
|
|
|
gl_gir = gnome.generate_gir(gstgl, kwargs: gir)
|
|
|
|
gen_sources += [gl_gir]
|
|
|
|
endif
|
2017-01-23 15:12:06 +00:00
|
|
|
endif
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries += [[pkg_name, library_def]]
|
2016-09-09 01:08:53 +00:00
|
|
|
gstgl_dep = declare_dependency(link_with : gstgl,
|
2018-06-18 12:24:13 +00:00
|
|
|
include_directories : [libsinc, compat_includes],
|
2017-01-23 15:12:06 +00:00
|
|
|
sources: gen_sources,
|
2022-12-25 04:41:52 +00:00
|
|
|
dependencies : [video_dep, gst_base_dep, gl_winsys_deps],
|
2022-12-28 22:22:42 +00:00
|
|
|
variables: pkgconfig_gl_variables)
|
2021-12-08 11:48:08 +00:00
|
|
|
gstglproto_dep = declare_dependency(
|
|
|
|
dependencies : [gstgl_dep] + gl_lib_deps,
|
|
|
|
sources: gen_sources
|
|
|
|
)
|
2018-04-08 00:52:12 +00:00
|
|
|
meson.override_dependency('gstreamer-gl-1.0', gstgl_dep)
|
|
|
|
meson.override_dependency('gstreamer-gl-prototypes-1.0', gstglproto_dep)
|
2020-07-23 09:48:55 +00:00
|
|
|
|
|
|
|
if gl_x11_headers.length() > 0
|
|
|
|
install_headers(gl_x11_headers, subdir : 'gstreamer-1.0/gst/gl/x11')
|
2020-06-27 04:39:00 +00:00
|
|
|
pkg_name = 'gstreamer-gl-x11-1.0'
|
2018-04-08 00:52:12 +00:00
|
|
|
pkgconfig.generate(
|
|
|
|
libraries : [gstgl],
|
|
|
|
requires: ['x11-xcb'],
|
|
|
|
subdirs : pkgconfig_subdirs,
|
2020-06-27 04:39:00 +00:00
|
|
|
name : pkg_name,
|
2018-04-08 00:52:12 +00:00
|
|
|
description : 'Streaming media framework, OpenGL plugins libraries (X11 specifics)',
|
|
|
|
)
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_x11_gir = []
|
|
|
|
if build_gir
|
2020-06-27 04:39:00 +00:00
|
|
|
gir = {
|
|
|
|
'sources' : gl_x11_sources + gl_x11_headers,
|
|
|
|
'namespace' : 'GstGLX11',
|
|
|
|
'nsversion' : api_version,
|
|
|
|
'identifier_prefix' : 'Gst',
|
|
|
|
'symbol_prefix' : 'gst',
|
|
|
|
'export_packages' : 'gstreamer-gl-x11-1.0',
|
|
|
|
'includes' : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
|
|
|
|
'install' : true,
|
|
|
|
'extra_args' : gir_init_section + ['--c-include=gst/gl/x11/x11.h'],
|
|
|
|
'dependencies' : [video_dep, gst_dep, gst_base_dep]
|
|
|
|
}
|
|
|
|
gir_dict = gir + {'includes': gir['includes'] + ['GstGL-1.0']}
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries += [[pkg_name, {'gir': gir_dict}]]
|
2020-06-27 04:39:00 +00:00
|
|
|
if not static_build
|
|
|
|
gir += {'includes': gir['includes'] + [gl_gir[0]]}
|
|
|
|
gl_x11_gir = gnome.generate_gir(gstgl, kwargs: gir)
|
|
|
|
endif
|
2020-07-23 09:48:55 +00:00
|
|
|
endif
|
2022-03-29 15:51:13 +00:00
|
|
|
gstglx11_dep = declare_dependency(dependencies : [gstgl_dep, x11_dep, xcb_dep],
|
2020-07-23 09:48:55 +00:00
|
|
|
sources : gl_x11_gir)
|
2018-04-08 00:52:12 +00:00
|
|
|
meson.override_dependency('gstreamer-gl-x11-1.0', gstglx11_dep)
|
2020-07-23 09:48:55 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if gl_wayland_headers.length() > 0
|
|
|
|
install_headers(gl_wayland_headers, subdir : 'gstreamer-1.0/gst/gl/wayland')
|
2020-06-27 04:39:00 +00:00
|
|
|
pkg_name = 'gstreamer-gl-wayland-1.0'
|
2018-04-08 00:52:12 +00:00
|
|
|
pkgconfig.generate(
|
|
|
|
libraries : [gstgl],
|
|
|
|
requires: ['wayland-egl', 'wayland-client'],
|
|
|
|
subdirs : pkgconfig_subdirs,
|
2020-06-27 04:39:00 +00:00
|
|
|
name : pkg_name,
|
2018-04-08 00:52:12 +00:00
|
|
|
description : 'Streaming media framework, OpenGL plugins libraries (Wayland specifics)',
|
|
|
|
)
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_wayland_gir = []
|
|
|
|
if build_gir
|
2020-06-27 04:39:00 +00:00
|
|
|
gir = {
|
|
|
|
'sources' : gl_wayland_sources + gl_wayland_headers,
|
|
|
|
'namespace' : 'GstGLWayland',
|
|
|
|
'nsversion' : api_version,
|
|
|
|
'identifier_prefix' : 'Gst',
|
|
|
|
'symbol_prefix' : 'gst',
|
|
|
|
'export_packages' : 'gstreamer-gl-wayland-1.0',
|
|
|
|
'includes' : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
|
|
|
|
'install' : true,
|
|
|
|
'extra_args' : gir_init_section + ['--c-include=gst/gl/wayland/wayland.h'],
|
|
|
|
'dependencies' : [video_dep, gst_dep, gst_base_dep]
|
|
|
|
}
|
|
|
|
|
|
|
|
gir_dict = gir + {'includes': gir['includes'] + ['GstGL-1.0']}
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries += [[pkg_name, {'gir': gir_dict}]]
|
2020-06-27 04:39:00 +00:00
|
|
|
if not static_build
|
|
|
|
gir += {'includes': gir['includes'] + [gl_gir[0]]}
|
|
|
|
gl_wayland_gir = gnome.generate_gir(gstgl, kwargs: gir)
|
|
|
|
endif
|
2020-07-23 09:48:55 +00:00
|
|
|
endif
|
|
|
|
gstglwayland_dep = declare_dependency(dependencies : [gstgl_dep],
|
|
|
|
sources : gl_wayland_gir)
|
2020-06-27 04:39:00 +00:00
|
|
|
meson.override_dependency(pkg_name, gstglwayland_dep)
|
2020-07-23 09:48:55 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
if gl_egl_headers.length() > 0
|
|
|
|
install_headers(gl_egl_headers, subdir : 'gstreamer-1.0/gst/gl/egl')
|
2020-06-27 04:39:00 +00:00
|
|
|
pkg_name = 'gstreamer-gl-egl-1.0'
|
2018-04-08 00:52:12 +00:00
|
|
|
pkgconfig.generate(
|
|
|
|
libraries : [gstgl, egl_dep],
|
|
|
|
subdirs : pkgconfig_subdirs,
|
2020-06-27 04:39:00 +00:00
|
|
|
name : pkg_name,
|
2018-04-08 00:52:12 +00:00
|
|
|
description : 'Streaming media framework, OpenGL plugins libraries (EGL specifics)',
|
|
|
|
)
|
2020-07-23 09:48:55 +00:00
|
|
|
gl_egl_gir = []
|
|
|
|
if build_gir
|
2020-06-27 04:39:00 +00:00
|
|
|
gir = {
|
|
|
|
'sources' : gl_egl_sources + gl_egl_headers,
|
|
|
|
'namespace' : 'GstGLEGL',
|
|
|
|
'nsversion' : api_version,
|
|
|
|
'identifier_prefix' : 'Gst',
|
|
|
|
'symbol_prefix' : 'gst',
|
|
|
|
'export_packages' : pkg_name,
|
|
|
|
'includes' : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
|
|
|
|
'install' : true,
|
|
|
|
'extra_args' : gir_init_section + ['--c-include=gst/gl/egl/egl.h'],
|
|
|
|
'dependencies' : [video_dep, gst_dep, gst_base_dep]
|
|
|
|
}
|
2021-10-16 01:07:39 +00:00
|
|
|
gir_dict = gir + {'includes': gir['includes'] + ['GstGL-1.0']}
|
2022-09-01 15:51:48 +00:00
|
|
|
gst_libraries += [[pkg_name, {'gir': gir_dict}]]
|
2020-06-27 04:39:00 +00:00
|
|
|
if not static_build
|
2021-10-16 01:07:39 +00:00
|
|
|
gir += {'includes': gir['includes'] + [gl_gir[0]]}
|
2020-06-27 04:39:00 +00:00
|
|
|
gl_egl_gir = gnome.generate_gir(gstgl, kwargs: gir)
|
|
|
|
endif
|
2020-07-23 09:48:55 +00:00
|
|
|
endif
|
|
|
|
gstglegl_dep = declare_dependency(dependencies : [gstgl_dep],
|
|
|
|
sources : gl_egl_gir)
|
2020-06-27 04:39:00 +00:00
|
|
|
meson.override_dependency(pkg_name, gstglegl_dep)
|
2020-07-23 09:48:55 +00:00
|
|
|
endif
|
2018-08-16 09:28:48 +00:00
|
|
|
|
|
|
|
elif get_option('gl').enabled()
|
|
|
|
error('GStreamer OpenGL integration required via options, but needed dependencies not found.')
|
2016-09-09 01:08:53 +00:00
|
|
|
endif
|