From c38d3a41e2626423f677040b16cbbf8e71f3ae7d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 15 Nov 2016 17:46:17 -0300 Subject: [PATCH] meson: Build waylandsink https://bugzilla.gnome.org/show_bug.cgi?id=774493 --- ext/meson.build | 2 +- ext/wayland/meson.build | 44 ++++++++++++++++++++++++++++++++ gst-libs/gst/meson.build | 7 +++-- gst-libs/gst/wayland/meson.build | 13 ++++++++++ meson.build | 10 ++++++++ 5 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 ext/wayland/meson.build create mode 100644 gst-libs/gst/wayland/meson.build diff --git a/ext/meson.build b/ext/meson.build index d58457ba7c..c4898d8954 100644 --- a/ext/meson.build +++ b/ext/meson.build @@ -67,7 +67,7 @@ subdir('ttml') subdir('voaacenc') #subdir('voamrwbenc') subdir('vulkan') -#subdir('wayland') +subdir('wayland') #subdir('webrtcdsp') subdir('webp') subdir('x265') diff --git a/ext/wayland/meson.build b/ext/wayland/meson.build new file mode 100644 index 0000000000..654a644b0d --- /dev/null +++ b/ext/wayland/meson.build @@ -0,0 +1,44 @@ +wl_sources = [ + 'gstwaylandsink.c', + 'wlshmallocator.c', + 'wlbuffer.c', + 'wldisplay.c', + 'wlwindow.c', + 'wlvideoformat.c', + 'wllinuxdmabuf.c' +] + +if use_wayland + protocols_datadir = wl_protocol_dep.get_pkgconfig_variable('pkgdatadir') + + protocol_defs = [ + ['/stable/viewporter/viewporter.xml', 'viewporter-protocol.c', 'viewporter-client-protocol.h'], + ['/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml', + 'linux-dmabuf-unstable-v1-protocol.c', 'linux-dmabuf-unstable-v1-client-protocol.h'] + ] + protocols_files = [] + + foreach protodef: protocol_defs + xmlfile = protocols_datadir + protodef.get(0) + + protocols_files += [custom_target(protodef.get(1), + output : protodef.get(1), + input : xmlfile, + command : [wl_scanner, 'code', '@INPUT@', '@OUTPUT@'])] + + protocols_files += [custom_target(protodef.get(2), + output : protodef.get(2), + input : xmlfile, + command : [wl_scanner, 'client-header', '@INPUT@', '@OUTPUT@'])] + endforeach + + gstwaylandsink = library('gstwaylandsink', + wl_sources + protocols_files, + c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'], + include_directories : [configinc], + dependencies : [gst_dep, gstvideo_dep, gstwayland_dep, gstallocators_dep, + wl_client_dep, wl_protocol_dep, libdrm_dep], + install : true, + install_dir : plugins_install_dir, + ) +endif diff --git a/gst-libs/gst/meson.build b/gst-libs/gst/meson.build index d6c2bd6094..b5e45724ac 100644 --- a/gst-libs/gst/meson.build +++ b/gst-libs/gst/meson.build @@ -10,8 +10,7 @@ subdir('interfaces') subdir('mpegts') subdir('player') subdir('video') - -# FIXME: port configure.ac logic -#subdir('wayland') - +if use_wayland + subdir('wayland') +endif subdir('gl') diff --git a/gst-libs/gst/wayland/meson.build b/gst-libs/gst/wayland/meson.build new file mode 100644 index 0000000000..634d2ddcb8 --- /dev/null +++ b/gst-libs/gst/wayland/meson.build @@ -0,0 +1,13 @@ +gstwayland = library('gstwayland-' + api_version, + 'wayland.c', + c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'], + include_directories : [configinc, libsinc], + version : libversion, + soversion : soversion, + install : true, + dependencies : [gst_dep, gstvideo_dep] +) + +gstwayland_dep = declare_dependency(link_with : gstwayland, + include_directories : [libsinc], + dependencies : [gst_dep, gstvideo_dep]) diff --git a/meson.build b/meson.build index 04ba44180b..4c7bac8679 100644 --- a/meson.build +++ b/meson.build @@ -331,6 +331,16 @@ else cdata.set('DISABLE_ORC', 1) endif +# Wayland checks + +wl_req = '>= 1.4' +wl_client_dep = dependency('wayland-client', version: wl_req, required: false) +libdrm_dep = dependency('libdrm', version: '>= 2.4.55', required: false) +wl_protocol_dep = dependency('wayland-protocols', version: wl_req, + required: false) +wl_scanner = find_program('wayland-scanner') +use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.found() and libdrm_dep.found() + configure_file(input : 'config.h.meson', output : 'config.h', configuration : cdata)