From c32bb269d779e7e121b899053599db2b8b0f5e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 5 Feb 2021 09:58:54 +0100 Subject: [PATCH] GStreamer meson build script cleanup --- lib/gst/clapper/meson.build | 8 +--- lib/meson.build | 75 ++++++++++++++----------------------- 2 files changed, 31 insertions(+), 52 deletions(-) diff --git a/lib/gst/clapper/meson.build b/lib/gst/clapper/meson.build index 1c6d9384..ea44b1da 100644 --- a/lib/gst/clapper/meson.build +++ b/lib/gst/clapper/meson.build @@ -39,12 +39,8 @@ have_gtk_gl_windowing = false gtk4_dep = dependency('gtk4', required : true) -if not gtk4_dep.found() or not gtk4_dep.version().version_compare('>=4.0.0') - error('GTK4 is missing or is too old') -endif - -if not have_gstgl - error('GstGL is missing') +if not gtk4_dep.version().version_compare('>=4.0.0') + error('GTK4 version on this system is too old') endif if gst_gl_have_window_x11 and gst_gl_have_platform_glx diff --git a/lib/meson.build b/lib/meson.build index bcbc3fbe..12c4e926 100644 --- a/lib/meson.build +++ b/lib/meson.build @@ -204,60 +204,44 @@ gstvideo_dep = dependency('gstreamer-video-1.0', version : gst_req, # GStreamer OpenGL gstgl_dep = dependency('gstreamer-gl-1.0', version : gst_req, - fallback : ['gst-plugins-base', 'gstgl_dep'], required: false) -gstglproto_dep = dependency('', required : false) + fallback : ['gst-plugins-base', 'gstgl_dep'], required: true) gstglx11_dep = dependency('', required : false) gstglwayland_dep = dependency('', required : false) gstglegl_dep = dependency('', required : false) -have_gstgl = gstgl_dep.found() +gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis') +gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys') +gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms') -if have_gstgl - if gstgl_dep.type_name() == 'pkgconfig' - gst_gl_apis = gstgl_dep.get_pkgconfig_variable('gl_apis').split() - gst_gl_winsys = gstgl_dep.get_pkgconfig_variable('gl_winsys').split() - gst_gl_platforms = gstgl_dep.get_pkgconfig_variable('gl_platforms').split() - else - gstbase = subproject('gst-plugins-base') - gst_gl_apis = gstbase.get_variable('enabled_gl_apis') - gst_gl_winsys = gstbase.get_variable('enabled_gl_winsys') - gst_gl_platforms = gstbase.get_variable('enabled_gl_platforms') - endif +message('GStreamer OpenGL window systems: @0@'.format(gst_gl_winsys)) +message('GStreamer OpenGL platforms: @0@'.format(gst_gl_platforms)) +message('GStreamer OpenGL apis: @0@'.format(gst_gl_apis)) - message('GStreamer OpenGL window systems: @0@'.format(' '.join(gst_gl_winsys))) - message('GStreamer OpenGL platforms: @0@'.format(' '.join(gst_gl_platforms))) - message('GStreamer OpenGL apis: @0@'.format(' '.join(gst_gl_apis))) +foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl', 'win32', 'dispmanx', 'viv_fb'] + set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws)) +endforeach - foreach ws : ['x11', 'wayland', 'android', 'cocoa', 'eagl', 'win32', 'dispmanx', 'viv_fb'] - set_variable('gst_gl_have_window_@0@'.format(ws), gst_gl_winsys.contains(ws)) - endforeach +foreach p : ['glx', 'egl', 'cgl', 'eagl', 'wgl'] + set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p)) +endforeach - foreach p : ['glx', 'egl', 'cgl', 'eagl', 'wgl'] - set_variable('gst_gl_have_platform_@0@'.format(p), gst_gl_platforms.contains(p)) - endforeach +foreach api : ['gl', 'gles2'] + set_variable('gst_gl_have_api_@0@'.format(api), gst_gl_apis.contains(api)) +endforeach - foreach api : ['gl', 'gles2'] - set_variable('gst_gl_have_api_@0@'.format(api), gst_gl_apis.contains(api)) - endforeach - - gstglproto_dep = dependency('gstreamer-gl-prototypes-1.0', version : gst_req, - fallback : ['gst-plugins-base', 'gstglproto_dep'], required: true) - # Behind specific checks because meson fails at optional dependencies with a - # fallback to the same subproject. On the first failure, meson will never - # check the system again even if the fallback never existed. - # Last checked with meson 0.54.3 - if gst_gl_have_window_x11 - gstglx11_dep = dependency('gstreamer-gl-x11-1.0', version : gst_req, - fallback : ['gst-plugins-base', 'gstglx11_dep'], required: true) - endif - if gst_gl_have_window_wayland - gstglwayland_dep = dependency('gstreamer-gl-wayland-1.0', version : gst_req, - fallback : ['gst-plugins-base', 'gstglwayland_dep'], required: true) - endif - if gst_gl_have_platform_egl - gstglegl_dep = dependency('gstreamer-gl-egl-1.0', version : gst_req, - fallback : ['gst-plugins-base', 'gstglegl_dep'], required: true) - endif +gstglproto_dep = dependency('gstreamer-gl-prototypes-1.0', version : gst_req, + fallback : ['gst-plugins-base', 'gstglproto_dep'], required: true) +if gst_gl_have_window_x11 + gstglx11_dep = dependency('gstreamer-gl-x11-1.0', version : gst_req, + fallback : ['gst-plugins-base', 'gstglx11_dep'], required: true) +endif +if gst_gl_have_window_wayland + gstglwayland_dep = dependency('gstreamer-gl-wayland-1.0', version : gst_req, + fallback : ['gst-plugins-base', 'gstglwayland_dep'], required: true) +endif +if gst_gl_have_platform_egl + gstglegl_dep = dependency('gstreamer-gl-egl-1.0', version : gst_req, + fallback : ['gst-plugins-base', 'gstglegl_dep'], required: true) endif libm = cc.find_library('m', required : false) @@ -280,7 +264,6 @@ endif configinc = include_directories('.') libsinc = include_directories('gst') -python3 = import('python').find_installation() gnome = import('gnome') gir = find_program('g-ir-scanner', required : true)