gtk4paintablesink: meson: Add auto-detection of GTK4 versions and dmabuf feature

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1547>
This commit is contained in:
Sebastian Dröge 2024-04-24 15:59:11 +02:00
parent c95e07a897
commit 5803904deb

View file

@ -304,6 +304,23 @@ if get_option('gtk4').allowed()
gtk4_features += 'winegl' gtk4_features += 'winegl'
endif endif
endif endif
gst_allocators_dep = dependency('gstreamer-allocators-1.0', version: '>=1.24', required: false)
gtk_dep = dependency('gtk4', version: '>=4.6', required: get_option('gtk4'))
if gtk_dep.found()
if host_system == 'linux' and gtk_dep.version().version_compare('>=4.14') and gst_allocators_dep.found()
gtk4_features += 'dmabuf'
endif
if gtk_dep.version().version_compare('>=4.14')
gtk4_features += 'gtk_v4_14'
elif gtk_dep.version().version_compare('>=4.12')
gtk4_features += 'gtk_v4_12'
elif gtk_dep.version().version_compare('>=4.10')
gtk4_features += 'gtk_v4_10'
endif
endif
plugins += { plugins += {
'gtk4': { 'gtk4': {
'library': 'libgstgtk4', 'library': 'libgstgtk4',