From dd5f7f1bf97eaec3d967b3fe670e3e600088904a Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 23 Jul 2020 19:48:55 +1000 Subject: [PATCH] gl: move each gl platform specific API to its own gir With contributions from: Thibault Saunier Matthew Waters Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/651 Part-of: --- docs/libs/gl-egl/index.md | 4 + docs/libs/gl-egl/sitemap.txt | 1 + docs/libs/gl-wayland/index.md | 4 + docs/libs/gl-wayland/sitemap.txt | 1 + docs/libs/gl-x11/index.md | 4 + docs/libs/gl-x11/sitemap.txt | 1 + docs/meson.build | 15 ++- ext/gl/meson.build | 5 +- gst-libs/gst/gl/egl/gstglmemoryegl.h | 4 + gst-libs/gst/gl/gstgl_fwd.h | 4 - gst-libs/gst/gl/meson.build | 121 ++++++++++++++---- pkgconfig/gstreamer-gl-egl-uninstalled.pc.in | 13 ++ pkgconfig/gstreamer-gl-egl.pc.in | 11 ++ .../gstreamer-gl-prototypes-uninstalled.pc.in | 11 ++ pkgconfig/gstreamer-gl-prototypes.pc.in | 11 ++ pkgconfig/gstreamer-gl-uninstalled.pc.in | 4 +- .../gstreamer-gl-wayland-uninstalled.pc.in | 11 ++ pkgconfig/gstreamer-gl-wayland.pc.in | 9 ++ pkgconfig/gstreamer-gl-x11-uninstalled.pc.in | 11 ++ pkgconfig/gstreamer-gl-x11.pc.in | 9 ++ pkgconfig/gstreamer-gl.pc.in | 1 - pkgconfig/meson.build | 40 +++++- tests/check/meson.build | 30 ++--- tests/examples/gl/generic/cube/meson.build | 2 +- tests/examples/gl/generic/cubeyuv/meson.build | 2 +- .../gl/generic/doublecube/meson.build | 2 +- .../gl/generic/recordgraphic/meson.build | 2 +- tests/examples/gl/qt/meson.build | 2 +- .../gl/qt/mousevideooverlay/meson.build | 2 +- .../gl/qt/qglwidgetvideooverlay/meson.build | 2 +- .../gl/qt/qglwtextureshare/meson.build | 2 +- 31 files changed, 280 insertions(+), 61 deletions(-) create mode 100644 docs/libs/gl-egl/index.md create mode 100644 docs/libs/gl-egl/sitemap.txt create mode 100644 docs/libs/gl-wayland/index.md create mode 100644 docs/libs/gl-wayland/sitemap.txt create mode 100644 docs/libs/gl-x11/index.md create mode 100644 docs/libs/gl-x11/sitemap.txt create mode 100644 pkgconfig/gstreamer-gl-egl-uninstalled.pc.in create mode 100644 pkgconfig/gstreamer-gl-egl.pc.in create mode 100644 pkgconfig/gstreamer-gl-prototypes-uninstalled.pc.in create mode 100644 pkgconfig/gstreamer-gl-prototypes.pc.in create mode 100644 pkgconfig/gstreamer-gl-wayland-uninstalled.pc.in create mode 100644 pkgconfig/gstreamer-gl-wayland.pc.in create mode 100644 pkgconfig/gstreamer-gl-x11-uninstalled.pc.in create mode 100644 pkgconfig/gstreamer-gl-x11.pc.in diff --git a/docs/libs/gl-egl/index.md b/docs/libs/gl-egl/index.md new file mode 100644 index 0000000000..8ab8176da3 --- /dev/null +++ b/docs/libs/gl-egl/index.md @@ -0,0 +1,4 @@ +# GStreamer OpenGL Library - EGL + +This library should be linked to by getting cflags and libs from +`gstreamer-gl-egl-{{ gst_api_version.md }}.pc`. diff --git a/docs/libs/gl-egl/sitemap.txt b/docs/libs/gl-egl/sitemap.txt new file mode 100644 index 0000000000..4f91fcd8a3 --- /dev/null +++ b/docs/libs/gl-egl/sitemap.txt @@ -0,0 +1 @@ +gi-index diff --git a/docs/libs/gl-wayland/index.md b/docs/libs/gl-wayland/index.md new file mode 100644 index 0000000000..28ed9ce1d1 --- /dev/null +++ b/docs/libs/gl-wayland/index.md @@ -0,0 +1,4 @@ +# GStreamer OpenGL Library - Wayland + +This library should be linked to by getting cflags and libs from +`gstreamer-gl-wayland-{{ gst_api_version.md }}.pc`. diff --git a/docs/libs/gl-wayland/sitemap.txt b/docs/libs/gl-wayland/sitemap.txt new file mode 100644 index 0000000000..4f91fcd8a3 --- /dev/null +++ b/docs/libs/gl-wayland/sitemap.txt @@ -0,0 +1 @@ +gi-index diff --git a/docs/libs/gl-x11/index.md b/docs/libs/gl-x11/index.md new file mode 100644 index 0000000000..7dd19e6407 --- /dev/null +++ b/docs/libs/gl-x11/index.md @@ -0,0 +1,4 @@ +# GStreamer OpenGL Library - X11 + +This library should be linked to by getting cflags and libs from +`gstreamer-gl-x11-{{ gst_api_version.md }}.pc`. diff --git a/docs/libs/gl-x11/sitemap.txt b/docs/libs/gl-x11/sitemap.txt new file mode 100644 index 0000000000..4f91fcd8a3 --- /dev/null +++ b/docs/libs/gl-x11/sitemap.txt @@ -0,0 +1 @@ +gi-index diff --git a/docs/meson.build b/docs/meson.build index ad01d3a347..f15c3b0bbc 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -106,15 +106,26 @@ libs = [ ] if build_gstgl - libs += [['gl', gl_gir, gstgl_dep, [ + libs += [['gl', gl_gir, gstgl_dep]] + if enabled_gl_platforms.contains('egl') + libs += [['gl-egl', gl_egl_gir, gstgl_dep, [ join_paths('../gst-libs/gst', 'gl', 'egl', 'gstegl.[ch]'), join_paths('../gst-libs/gst', 'gl', 'egl', 'gsteglimage.[ch]'), join_paths('../gst-libs/gst', 'gl', 'egl', 'gstgldisplay_egl.[ch]'), join_paths('../gst-libs/gst', 'gl', 'egl', 'gstgldisplay_egl_device.[ch]'), join_paths('../gst-libs/gst', 'gl', 'egl', 'gstglmemoryegl.[ch]'), + ]]] + endif + if enabled_gl_winsys.contains('x11') + libs += [['gl-x11', gl_x11_gir, gstgl_dep, [ join_paths('../gst-libs/gst', 'gl', 'x11', 'gstgldisplay_x11.[ch]'), + ]]] + endif + if enabled_gl_winsys.contains('wayland') + libs += [['gl-wayland', gl_wayland_gir, gstgl_dep, [ join_paths('../gst-libs/gst', 'gl', 'wayland', 'gstgldisplay_wayland.[ch]'), - ]]] + ]]] + endif endif # Used to avoid conflicts with known plugin names diff --git a/ext/gl/meson.build b/ext/gl/meson.build index 64ef7f0da9..7a064261da 100644 --- a/ext/gl/meson.build +++ b/ext/gl/meson.build @@ -95,13 +95,14 @@ if png_dep.found() endif if glconf.get('GST_GL_HAVE_WINDOW_COCOA', 0) == 1 + corefoundation_dep = dependency('appleframeworks', modules : ['CoreFoundation'], required : false) foundation_dep = dependency('appleframeworks', modules : ['Foundation'], required : false) quartzcore_dep = dependency('appleframeworks', modules : ['QuartzCore'], required : false) - if foundation_dep.found() and quartzcore_dep.found() # have cocoa + if corefoundation_dep.found() and foundation_dep.found() and quartzcore_dep.found() # have cocoa opengl_sources += [ 'caopengllayersink.m', ] - optional_deps += quartzcore_dep + optional_deps += [quartzcore_dep, foundation_dep, corefoundation_dep] endif endif diff --git a/gst-libs/gst/gl/egl/gstglmemoryegl.h b/gst-libs/gst/gl/egl/gstglmemoryegl.h index a2a6843c3c..a45b6f9066 100644 --- a/gst-libs/gst/gl/egl/gstglmemoryegl.h +++ b/gst-libs/gst/gl/egl/gstglmemoryegl.h @@ -39,6 +39,10 @@ GST_GL_API GType gst_gl_memory_egl_allocator_get_type(void); #define GST_GL_MEMORY_EGL_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_MEMORY_EGL_ALLOCATOR, GstGLMemoryEGLAllocatorClass)) #define GST_GL_MEMORY_EGL_ALLOCATOR_CAST(obj) ((GstGLMemoryEGLAllocator *)(obj)) +typedef struct _GstGLMemoryEGL GstGLMemoryEGL; +typedef struct _GstGLMemoryEGLAllocator GstGLMemoryEGLAllocator; +typedef struct _GstGLMemoryEGLAllocatorClass GstGLMemoryEGLAllocatorClass; + /** * GstGLMemoryEGL: * diff --git a/gst-libs/gst/gl/gstgl_fwd.h b/gst-libs/gst/gl/gstgl_fwd.h index 9e8423696b..28af5c4a43 100644 --- a/gst-libs/gst/gl/gstgl_fwd.h +++ b/gst-libs/gst/gl/gstgl_fwd.h @@ -55,10 +55,6 @@ typedef struct _GstGLMemoryPBO GstGLMemoryPBO; typedef struct _GstGLMemoryPBOAllocator GstGLMemoryPBOAllocator; typedef struct _GstGLMemoryPBOAllocatorClass GstGLMemoryPBOAllocatorClass; -typedef struct _GstGLMemoryEGL GstGLMemoryEGL; -typedef struct _GstGLMemoryEGLAllocator GstGLMemoryEGLAllocator; -typedef struct _GstGLMemoryEGLAllocatorClass GstGLMemoryEGLAllocatorClass; - typedef struct _GstGLRenderbuffer GstGLRenderbuffer; typedef struct _GstGLRenderbufferAllocator GstGLRenderbufferAllocator; typedef struct _GstGLRenderbufferAllocatorClass GstGLRenderbufferAllocatorClass; diff --git a/gst-libs/gst/gl/meson.build b/gst-libs/gst/gl/meson.build index e3982322a1..31010da61a 100644 --- a/gst-libs/gst/gl/meson.build +++ b/gst-libs/gst/gl/meson.build @@ -96,8 +96,11 @@ gl_prototype_headers = [ 'glprototypes/vao.h', ] +gl_x11_sources = [] gl_x11_headers = [] +gl_wayland_sources = [] gl_wayland_headers = [] +gl_egl_sources = [] gl_egl_headers = [] glconf = configuration_data() @@ -489,7 +492,7 @@ if need_platform_egl != 'no' endif if egl_dep.found() - gl_sources += [ + gl_egl_sources += [ 'egl/gstegl.c', 'egl/gsteglimage.c', 'egl/gstglcontext_egl.c', @@ -571,12 +574,12 @@ if need_win_wayland != 'no' output: 'xdg-shell-client-protocol.c', ) - gl_sources += [ + gl_wayland_sources += [ 'wayland/gstgldisplay_wayland.c', - 'wayland/gstglwindow_wayland_egl.c', - 'wayland/wayland_event_source.c', ] gl_priv_sources += [ + 'wayland/gstglwindow_wayland_egl.c', + 'wayland/wayland_event_source.c', xdg_shell_header, xdg_shell_code, ] @@ -610,8 +613,10 @@ endif if need_win_x11 != 'no' xcb_dep = dependency('x11-xcb', required : false) if x11_dep.found() and xcb_dep.found() - gl_sources += [ + gl_x11_sources += [ 'x11/gstgldisplay_x11.c', + ] + gl_priv_sources += [ 'x11/gstglwindow_x11.c', 'x11/xcb_event_source.c', ] @@ -624,7 +629,7 @@ if need_win_x11 != 'no' if need_platform_glx != 'no' and glx_dep.found() and cc.has_function ('glXMakeCurrent', dependencies : glx_dep) glconf.set('GST_GL_HAVE_PLATFORM_GLX', 1) - gl_sources += [ + gl_priv_sources += [ 'x11/gstglcontext_glx.c', ] # GLX is in the opengl library on linux @@ -651,7 +656,7 @@ if need_win_dispmanx != 'no' error('dispmanx requires the use of egl') endif - gl_sources += [ + gl_priv_sources += [ 'dispmanx/gstglwindow_dispmanx_egl.c' ] @@ -688,8 +693,7 @@ if host_system == 'windows' and need_win_win32 != 'no' if have_wgl or have_egl_win32 gl_includes += [compat_includes] gl_platform_deps += gdi_dep - gl_sources += [ - 'win32/gstglwindow_win32.c', + gl_priv_sources += [ 'win32/gstglwindow_win32.c', ] enabled_gl_winsys += 'win32' @@ -698,7 +702,7 @@ if host_system == 'windows' and need_win_win32 != 'no' endif if have_wgl - gl_sources += [ + gl_priv_sources += [ 'wgl/gstglcontext_wgl.c', ] enabled_gl_platforms += 'wgl' @@ -721,7 +725,7 @@ if need_win_winrt != 'no' and host_system == 'windows' if windows_graphics_h and windows_app_dep.found() and runtimeobject_lib.found() enabled_gl_winsys += 'winrt' glconf.set10('GST_GL_HAVE_WINDOW_WINRT', 1) - gl_sources += [ + gl_priv_sources += [ 'winrt/gstglwindow_winrt_egl.cpp' ] gl_winsys_deps += runtimeobject_lib @@ -773,7 +777,7 @@ if host_system == 'darwin' if need_win_cocoa != 'no' cocoa_dep = dependency('appleframeworks', modules : ['Cocoa'], required : false) if cocoa_dep.found() - gl_sources += [ + gl_priv_sources += [ 'cocoa/gstglcaopengllayer.m', 'cocoa/gstglcontext_cocoa.m', 'cocoa/gstgldisplay_cocoa.m', @@ -820,7 +824,7 @@ if host_system == 'ios' and need_platform_eagl != 'no' and need_win_eagl != 'no' quartzcore_dep, uikit_dep, ] - gl_sources += [ + gl_priv_sources += [ 'eagl/gstglcontext_eagl.m', 'eagl/gstglwindow_eagl.m', ] @@ -848,7 +852,7 @@ if need_win_gbm != 'no' 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() - gl_sources += [ + gl_priv_sources += [ 'gbm/gstgldisplay_gbm.c', 'gbm/gstgl_gbm_utils.c', 'gbm/gstglwindow_gbm_egl.c', @@ -872,7 +876,7 @@ if need_platform_egl != 'no' and need_win_viv_fb != 'no' enabled_gl_winsys += 'viv-fb' glconf.set10('GST_GL_HAVE_WINDOW_VIV_FB', 1) glconf.set10('GST_GL_HAVE_VIV_DIRECTVIV', 1) - gl_sources += [ + gl_priv_sources += [ 'viv-fb/gstgldisplay_viv_fb.c', 'viv-fb/gstglwindow_viv_fb_egl.c', ] @@ -895,7 +899,7 @@ if host_system == 'android' and need_win_android != 'no' and need_platform_egl ! if gles2_dep.found() and egl_dep.found() enabled_gl_winsys += ['android'] glconf.set10('GST_GL_HAVE_WINDOW_ANDROID', 1) - gl_sources += [ + gl_priv_sources += [ 'android/gstglwindow_android_egl.c' ] endif @@ -918,6 +922,12 @@ if enabled_gl_winsys.length() == 0 build_gstgl = false endif +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) + if build_gstgl # find some types that may or may not be defined if cc.has_type('GLeglImageOES', prefix : gl_include_block, dependencies : gl_lib_deps, include_directories : gl_includes) @@ -953,10 +963,7 @@ if build_gstgl message('Building libgstgl with GL winsys: ' + ' '.join(enabled_gl_winsys)) install_headers(gl_headers, subdir : 'gstreamer-1.0/gst/gl') - install_headers(gl_egl_headers, subdir : 'gstreamer-1.0/gst/gl/egl') install_headers(gl_prototype_headers, subdir : 'gstreamer-1.0/gst/gl/glprototypes') - install_headers(gl_x11_headers, subdir : 'gstreamer-1.0/gst/gl/x11') - install_headers(gl_wayland_headers, subdir : 'gstreamer-1.0/gst/gl/wayland') configure_file(input : 'gstglconfig.h.meson', output : 'gstglconfig.h', @@ -975,20 +982,21 @@ if build_gstgl gen_sources = [gl_enumtypes_h] gstgl = library('gstgl-' + api_version, - gl_sources, gl_priv_sources, gl_enumtypes_c, gl_enumtypes_h, + gl_sources, gl_egl_sources, gl_x11_sources, gl_wayland_sources, gl_priv_sources, gl_enumtypes_c, gl_enumtypes_h, c_args : gst_plugins_base_args + gl_cpp_args + ['-DBUILDING_GST_GL'], cpp_args : gst_plugins_base_args + gl_cpp_args + ['-DBUILDING_GST_GL'], objc_args : gst_plugins_base_args + gl_cpp_args + gl_objc_args + ['-DBUILDING_GST_GL'], include_directories : [configinc, libsinc, gl_includes], version : libversion, soversion : soversion, - darwin_versions : osxversion, + darwin_versions : osxversion, install : true, dependencies : [gst_base_dep, video_dep, allocators_dep, gmodule_dep, gl_lib_deps, gl_platform_deps, gl_winsys_deps, gl_misc_deps]) + if build_gir gl_gir = gnome.generate_gir(gstgl, - sources : gl_sources + [gl_enumtypes_h] + [gl_enumtypes_c] + gir_gl_headers + gl_x11_headers + gl_wayland_headers + gl_egl_headers, + sources : gl_sources + [gl_enumtypes_h] + [gl_enumtypes_c] + gir_gl_headers, namespace : 'GstGL', nsversion : api_version, identifier_prefix : 'Gst', @@ -1002,14 +1010,75 @@ if build_gstgl gen_sources += gl_gir endif - gstgl_dep = declare_dependency(link_with : gstgl, include_directories : [libsinc, compat_includes], sources: gen_sources, - dependencies : [video_dep, gst_base_dep] + gl_lib_deps + gl_winsys_deps) + dependencies : [video_dep, gst_base_dep]) + gstglproto_dep = declare_dependency(dependencies : [gstgl_dep] + gl_lib_deps) + + if gl_x11_headers.length() > 0 + install_headers(gl_x11_headers, subdir : 'gstreamer-1.0/gst/gl/x11') + gl_x11_gir = [] + if build_gir + gl_x11_gir = gnome.generate_gir(gstgl, + 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', gl_gir[0]], + install : true, + extra_args : gir_init_section + ['--c-include=gst/gl/gl.h'], + dependencies : [video_dep, gst_dep, gst_base_dep] + ) + endif + gstglx11_dep = declare_dependency(dependencies : [gstgl_dep], + sources : gl_x11_gir) + endif + + if gl_wayland_headers.length() > 0 + install_headers(gl_wayland_headers, subdir : 'gstreamer-1.0/gst/gl/wayland') + gl_wayland_gir = [] + if build_gir + gl_wayland_gir = gnome.generate_gir(gstgl, + 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', gl_gir[0]], + install : true, + extra_args : gir_init_section + ['--c-include=gst/gl/gl.h'], + dependencies : [video_dep, gst_dep, gst_base_dep] + ) + endif + gstglwayland_dep = declare_dependency(dependencies : [gstgl_dep], + sources : gl_wayland_gir) + endif + + if gl_egl_headers.length() > 0 + install_headers(gl_egl_headers, subdir : 'gstreamer-1.0/gst/gl/egl') + gl_egl_gir = [] + if build_gir + gl_egl_gir = gnome.generate_gir(gstgl, + sources : gl_egl_sources + gl_egl_headers, + namespace : 'GstGLEGL', + nsversion : api_version, + identifier_prefix : 'Gst', + symbol_prefix : 'gst', + export_packages : 'gstreamer-gl-egl-1.0', + includes : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0', gl_gir[0]], + install : true, + extra_args : gir_init_section + ['--c-include=gst/gl/gl.h'], + dependencies : [video_dep, gst_dep, gst_base_dep] + ) + endif + gstglegl_dep = declare_dependency(dependencies : [gstgl_dep], + sources : gl_egl_gir) + endif elif get_option('gl').enabled() error('GStreamer OpenGL integration required via options, but needed dependencies not found.') -else - gstgl_dep = dependency('', required : false) endif diff --git a/pkgconfig/gstreamer-gl-egl-uninstalled.pc.in b/pkgconfig/gstreamer-gl-egl-uninstalled.pc.in new file mode 100644 index 0000000000..94165573b6 --- /dev/null +++ b/pkgconfig/gstreamer-gl-egl-uninstalled.pc.in @@ -0,0 +1,13 @@ +prefix= +exec_prefix= +libdir=@gllibdir@ +includedir=@abs_top_builddir@/gst-libs +girdir=@abs_top_builddir@/gst-libs/gst/gl +typelibdir=@abs_top_builddir@/gst-libs/gst/gl + +Name: GStreamer OpenGL Plugins Libraries (EGL Specifics), Uninstalled +Description: Streaming media framework, OpenGL plugins libraries (EGL specifics), uninstalled +Version: @VERSION@ +Requires: gtreamer-gl-@GST_API_VERSION@ @GL_EGL_EXTRA_REQUIRES@ + +Libs: @GL_EGL_EXTRA_LIBS@ diff --git a/pkgconfig/gstreamer-gl-egl.pc.in b/pkgconfig/gstreamer-gl-egl.pc.in new file mode 100644 index 0000000000..d523a7b842 --- /dev/null +++ b/pkgconfig/gstreamer-gl-egl.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/gstreamer-@GST_API_VERSION@ + +Name: GStreamer OpenGL Plugins Libraries (Wayland specifics) +Description: Streaming media framework, OpenGL plugins libraries (Wayland specifics) +Version: @VERSION@ +Requires: gstreamer-gl-@GST_API_VERSION@ @GL_EGL_EXTRA_REQUIRES@ + +Libs: @GL_EGL_EXTRA_LIBS@ diff --git a/pkgconfig/gstreamer-gl-prototypes-uninstalled.pc.in b/pkgconfig/gstreamer-gl-prototypes-uninstalled.pc.in new file mode 100644 index 0000000000..05141d80a6 --- /dev/null +++ b/pkgconfig/gstreamer-gl-prototypes-uninstalled.pc.in @@ -0,0 +1,11 @@ +prefix= +exec_prefix= +libdir=@gllibdir@ +includedir=@abs_top_builddir@/gst-libs + +Name: GStreamer OpenGL Plugins Libraries (OpenGL Prototypes), Uninstalled +Description: Streaming media framework, OpenGL plugins libraries (OpenGL Prototypes), uninstalled +Version: @VERSION@ +Requires: gstreamer-gl-@GST_API_VERSION@ @GL_PROTO_EXTRA_REQUIRES@ + +Libs: @GL_PROTO_EXTRA_LIBS@ diff --git a/pkgconfig/gstreamer-gl-prototypes.pc.in b/pkgconfig/gstreamer-gl-prototypes.pc.in new file mode 100644 index 0000000000..cdc1bed58b --- /dev/null +++ b/pkgconfig/gstreamer-gl-prototypes.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/gstreamer-@GST_API_VERSION@ + +Name: GStreamer OpenGL Plugins Libraries (OpenGL Prototypes) +Description: Streaming media framework, OpenGL plugins libraries (OpenGL Prototypes) +Version: @VERSION@ +Requires: gstreamer-gl-@GST_API_VERSION@ @GL_PROTO_EXTRA_REQUIRES@ + +Libs: @GL_PROTO_EXTRA_LIBS@ diff --git a/pkgconfig/gstreamer-gl-uninstalled.pc.in b/pkgconfig/gstreamer-gl-uninstalled.pc.in index 8beed593f3..74cc776bdb 100644 --- a/pkgconfig/gstreamer-gl-uninstalled.pc.in +++ b/pkgconfig/gstreamer-gl-uninstalled.pc.in @@ -2,8 +2,8 @@ prefix= exec_prefix= libdir=@gllibdir@ includedir=@abs_top_builddir@/gst-libs -girdir=@abs_top_builddir@/gst-libs/gst/base -typelibdir=@abs_top_builddir@/gst-libs/gst/base +girdir=@abs_top_builddir@/gst-libs/gst/gl +typelibdir=@abs_top_builddir@/gst-libs/gst/gl gl_platforms=@GL_PLATFORMS@ gl_winsys=@GL_WINDOWS@ gl_apis=@GL_APIS@ diff --git a/pkgconfig/gstreamer-gl-wayland-uninstalled.pc.in b/pkgconfig/gstreamer-gl-wayland-uninstalled.pc.in new file mode 100644 index 0000000000..b1716e48a3 --- /dev/null +++ b/pkgconfig/gstreamer-gl-wayland-uninstalled.pc.in @@ -0,0 +1,11 @@ +prefix= +exec_prefix= +libdir=@gllibdir@ +includedir=@abs_top_builddir@/gst-libs +girdir=@abs_top_builddir@/gst-libs/gst/gl +typelibdir=@abs_top_builddir@/gst-libs/gst/gl + +Name: GStreamer OpenGL Plugins Libraries (Wayland Specifics), Uninstalled +Description: Streaming media framework, OpenGL plugins libraries (Wayland specifics), uninstalled +Version: @VERSION@ +Requires: gtreamer-gl-@GST_API_VERSION@ wayland-egl wayland-client diff --git a/pkgconfig/gstreamer-gl-wayland.pc.in b/pkgconfig/gstreamer-gl-wayland.pc.in new file mode 100644 index 0000000000..d0686cd311 --- /dev/null +++ b/pkgconfig/gstreamer-gl-wayland.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/gstreamer-@GST_API_VERSION@ + +Name: GStreamer OpenGL Plugins Libraries (Wayland specifics) +Description: Streaming media framework, OpenGL plugins libraries (Wayland specifics) +Version: @VERSION@ +Requires: gstreamer-gl-@GST_API_VERSION@ wayland-egl wayland-client diff --git a/pkgconfig/gstreamer-gl-x11-uninstalled.pc.in b/pkgconfig/gstreamer-gl-x11-uninstalled.pc.in new file mode 100644 index 0000000000..4b6e0eb2e8 --- /dev/null +++ b/pkgconfig/gstreamer-gl-x11-uninstalled.pc.in @@ -0,0 +1,11 @@ +prefix= +exec_prefix= +libdir=@gllibdir@ +includedir=@abs_top_builddir@/gst-libs +girdir=@abs_top_builddir@/gst-libs/gst/gl +typelibdir=@abs_top_builddir@/gst-libs/gst/gl + +Name: GStreamer OpenGL Plugins Libraries (X11 Specifics), Uninstalled +Description: Streaming media framework, OpenGL plugins libraries (X11 specifics), uninstalled +Version: @VERSION@ +Requires: gtreamer-gl-@GST_API_VERSION@ x11-xcb diff --git a/pkgconfig/gstreamer-gl-x11.pc.in b/pkgconfig/gstreamer-gl-x11.pc.in new file mode 100644 index 0000000000..0d50fd6892 --- /dev/null +++ b/pkgconfig/gstreamer-gl-x11.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/gstreamer-@GST_API_VERSION@ + +Name: GStreamer OpenGL Plugins Libraries (X11 specifics) +Description: Streaming media framework, OpenGL plugins libraries (X11 specifics) +Version: @VERSION@ +Requires: gstreamer-gl-@GST_API_VERSION@ x11-xcb diff --git a/pkgconfig/gstreamer-gl.pc.in b/pkgconfig/gstreamer-gl.pc.in index 8c290bab51..aa0bb364fc 100644 --- a/pkgconfig/gstreamer-gl.pc.in +++ b/pkgconfig/gstreamer-gl.pc.in @@ -2,7 +2,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/gstreamer-@GST_API_VERSION@ -pluginsdir=@libdir@/gstreamer-@GST_API_VERSION@ gl_platforms=@GL_PLATFORMS@ gl_winsys=@GL_WINDOWS@ gl_apis=@GL_APIS@ diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build index bd54d01e98..8757894ef0 100644 --- a/pkgconfig/meson.build +++ b/pkgconfig/meson.build @@ -47,11 +47,49 @@ if build_gstgl gllibdir = join_paths(meson.build_root(), gstgl.outdir()) pkgconf.set('gllibdir', gllibdir) pkgconf.set('glliblinkerflag', '-L' + gllibdir) - pkg_files += ['gstreamer-gl'] + pkg_files += ['gstreamer-gl', 'gstreamer-gl-prototypes'] pkgconf.set('GL_APIS', ' '.join(enabled_gl_apis)) pkgconf.set('GL_WINDOWS', ' '.join(enabled_gl_winsys)) pkgconf.set('GL_PLATFORMS', ' '.join(enabled_gl_platforms)) pkgconf.set('gl_lib_name', 'gl') + gl_proto_requires = '' + gl_proto_libs = '' + if enabled_gl_apis.contains('gl') + if gl_dep.type_name() == 'pkgconfig' + gl_proto_requires += ' gl' + elif gl_dep.type_name() == 'library' + gl_proto_libs += ' -lGL' + elif gl_dep.type_name() == 'appleframework' + gl_proto_libs += ' -framework OpenGL' + endif + endif + if enabled_gl_apis.contains('gles2') + if gles2_dep.type_name() == 'pkgconfig' + gl_proto_requires += ' glesv2' + elif gles2_dep.type_name() == 'library' + gl_proto_libs += ' -lGLESv2' + elif gles2_dep.type_name() == 'appleframework' + gl_proto_libs += ' -framework OpenGLES' + endif + endif + pkgconf.set('GL_PROTO_EXTRA_REQUIRES', gl_proto_requires) + pkgconf.set('GL_PROTO_EXTRA_LIBS', gl_proto_libs) + if enabled_gl_platforms.contains('egl') + pkg_files += ['gstreamer-gl-egl'] + if egl_dep.type_name() == 'pkgconfig' + pkgconf.set('GL_EGL_EXTRA_REQUIRES', 'egl') + pkgconf.set('GL_EGL_EXTRA_LIBS', '') + elif egl_dep.type_name() == 'library' + pkgconf.set('GL_EGL_EXTRA_REQUIRES', '') + pkgconf.set('GL_EGL_EXTRA_LIBS', '-lEGL') + endif + endif + if enabled_gl_winsys.contains('x11') + pkg_files += ['gstreamer-gl-x11'] + endif + if enabled_gl_winsys.contains('wayland') + pkg_files += ['gstreamer-gl-wayland'] + endif else pkgconf.set('glliblinkerflag', '') pkgconf.set('gl_lib_name', '') diff --git a/tests/check/meson.build b/tests/check/meson.build index 8309bbdd41..c2702f3556 100644 --- a/tests/check/meson.build +++ b/tests/check/meson.build @@ -86,24 +86,24 @@ endif # FIXME: Unstable on Windows if build_gstgl and host_machine.system() != 'windows' base_tests += [ - [ 'libs/gstglcolorconvert.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglcontext.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglfeature.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglformat.c', not build_gstgl, [gstgl_dep]], + [ 'libs/gstglcolorconvert.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglcontext.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglfeature.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglformat.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], [ 'libs/gstglheaders.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglmatrix.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglmemory.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglquery.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglshader.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglsl.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglslstage.c', not build_gstgl, [gstgl_dep]], - [ 'libs/gstglupload.c', not build_gstgl, [gstgl_dep]], - [ 'elements/glimagesink.c', not build_gstgl, [gstgl_dep]], + [ 'libs/gstglmatrix.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglmemory.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglquery.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglshader.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglsl.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglslstage.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'libs/gstglupload.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'elements/glimagesink.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], [ 'elements/glbin.c', not build_gstgl ], [ 'pipelines/gl-launch-lines.c', not build_gstgl ], - [ 'elements/glfilter.c', not build_gstgl, [gstgl_dep]], - [ 'elements/glstereo.c', not build_gstgl, [gstgl_dep]], - [ 'elements/glmixer.c', not build_gstgl, [gstgl_dep]], + [ 'elements/glfilter.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'elements/glstereo.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], + [ 'elements/glmixer.c', not build_gstgl, [gstgl_dep, gstglproto_dep]], ] endif diff --git a/tests/examples/gl/generic/cube/meson.build b/tests/examples/gl/generic/cube/meson.build index edb62460b5..5534ec702f 100644 --- a/tests/examples/gl/generic/cube/meson.build +++ b/tests/examples/gl/generic/cube/meson.build @@ -1,5 +1,5 @@ if have_cxx executable('cube', 'main.cpp', - dependencies : [gstgl_dep, gl_dep], + dependencies : [gstgl_dep, gstglproto_dep], install: false) endif diff --git a/tests/examples/gl/generic/cubeyuv/meson.build b/tests/examples/gl/generic/cubeyuv/meson.build index 38a43c9bf3..dcb93d4be1 100644 --- a/tests/examples/gl/generic/cubeyuv/meson.build +++ b/tests/examples/gl/generic/cubeyuv/meson.build @@ -1,5 +1,5 @@ if have_cxx executable('cubeyuv', 'main.cpp', - dependencies : [gstgl_dep, gl_dep], + dependencies : [gstgl_dep, gstglproto_dep], install: false) endif diff --git a/tests/examples/gl/generic/doublecube/meson.build b/tests/examples/gl/generic/doublecube/meson.build index 7c523e2dcb..f993991714 100644 --- a/tests/examples/gl/generic/doublecube/meson.build +++ b/tests/examples/gl/generic/doublecube/meson.build @@ -1,5 +1,5 @@ if have_cxx executable('doublecube', 'main.cpp', - dependencies : [gstgl_dep, gl_dep], + dependencies : [gstgl_dep, gstglproto_dep], install: false) endif diff --git a/tests/examples/gl/generic/recordgraphic/meson.build b/tests/examples/gl/generic/recordgraphic/meson.build index 938aa37d99..0634933dea 100644 --- a/tests/examples/gl/generic/recordgraphic/meson.build +++ b/tests/examples/gl/generic/recordgraphic/meson.build @@ -1,5 +1,5 @@ if have_cxx executable('recordgraphic', 'main.cpp', - dependencies : [gstgl_dep, gl_dep], + dependencies : [gstgl_dep, gstglproto_dep], install: false) endif diff --git a/tests/examples/gl/qt/meson.build b/tests/examples/gl/qt/meson.build index 523f8a10d3..ed0a0b0bb7 100644 --- a/tests/examples/gl/qt/meson.build +++ b/tests/examples/gl/qt/meson.build @@ -2,7 +2,7 @@ qt5_mod = import('qt5') qt5gui_dep = dependency('qt5', modules : ['Core', 'Gui', 'Widgets'], required : false) qt5opengl_dep = dependency('qt5', modules : ['OpenGL'], required : false) -# FIXME: other platforms +#FIXME; other platforms libgl = cc.find_library ('GL', required : false) qt_cxx_warn_less = cxx.get_supported_arguments(['-Wno-aggregate-return']) diff --git a/tests/examples/gl/qt/mousevideooverlay/meson.build b/tests/examples/gl/qt/mousevideooverlay/meson.build index a4f6071efc..ec09fb89e5 100644 --- a/tests/examples/gl/qt/mousevideooverlay/meson.build +++ b/tests/examples/gl/qt/mousevideooverlay/meson.build @@ -15,5 +15,5 @@ moc_files = qt5_mod.preprocess(moc_headers : moc_headers) executable('mousevideoverlay', sources, moc_files, cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less, include_directories: [configinc, libsinc], - dependencies : [qt5core_dep, qt5gui_dep, gst_dep, video_dep, gstgl_dep, libgl], + dependencies : [qt5core_dep, qt5gui_dep, gst_dep, video_dep, gstgl_dep, gstglproto_dep], install: false) diff --git a/tests/examples/gl/qt/qglwidgetvideooverlay/meson.build b/tests/examples/gl/qt/qglwidgetvideooverlay/meson.build index 176c4856a9..f9a885fc9f 100644 --- a/tests/examples/gl/qt/qglwidgetvideooverlay/meson.build +++ b/tests/examples/gl/qt/qglwidgetvideooverlay/meson.build @@ -15,5 +15,5 @@ moc_files = qt5_mod.preprocess(moc_headers : moc_headers) executable('qglwidgetvideoverlay', sources, moc_files, cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less, include_directories: [configinc, libsinc], - dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, gst_dep, video_dep, gstgl_dep, libgl], + dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, gst_dep, video_dep, gstgl_dep, gstglproto_dep], install: false) diff --git a/tests/examples/gl/qt/qglwtextureshare/meson.build b/tests/examples/gl/qt/qglwtextureshare/meson.build index 781bf3fe56..19c830a3f6 100644 --- a/tests/examples/gl/qt/qglwtextureshare/meson.build +++ b/tests/examples/gl/qt/qglwtextureshare/meson.build @@ -25,5 +25,5 @@ moc_files = qt5_mod.preprocess(moc_headers : moc_headers) executable('qglwtextureshare', sources, moc_files, cpp_args : [gst_plugins_base_args] + qt_cxx_warn_less, include_directories: [configinc, libsinc], - dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, qtwinsys_deps, gst_dep, video_dep, gstgl_dep, libgl], + dependencies : [qt5core_dep, qt5gui_dep, qt5opengl_dep, qtwinsys_deps, gst_dep, video_dep, gstgl_dep, gstglproto_dep], install: false)