meson: Build waylandsink
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Tue, 15 Nov 2016 20:46:17 +0000 (17:46 -0300)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Tue, 15 Nov 2016 21:33:25 +0000 (18:33 -0300)
https://bugzilla.gnome.org/show_bug.cgi?id=774493

ext/meson.build
ext/wayland/meson.build [new file with mode: 0644]
gst-libs/gst/meson.build
gst-libs/gst/wayland/meson.build [new file with mode: 0644]
meson.build

index d58457b..c4898d8 100644 (file)
@@ -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 (file)
index 0000000..654a644
--- /dev/null
@@ -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
index d6c2bd6..b5e4572 100644 (file)
@@ -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 (file)
index 0000000..634d2dd
--- /dev/null
@@ -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])
index 04ba441..4c7bac8 100644 (file)
@@ -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)