meson: build vdpau plugin
authorTim-Philipp Müller <tim@centricular.com>
Sun, 16 Dec 2018 00:41:23 +0000 (00:41 +0000)
committerSebastian Dröge <slomo@coaxion.net>
Mon, 17 Dec 2018 09:12:53 +0000 (09:12 +0000)
meson_options.txt
sys/meson.build
sys/vdpau/meson.build [new file with mode: 0644]

index 513aa06..6ac0474 100644 (file)
@@ -134,6 +134,7 @@ option('tinyalsa', type : 'feature', value : 'auto', description : 'TinyALSA plu
 option('ttml', type : 'feature', value : 'auto', description : 'TTML subtitle parser and renderer plugin')
 option('uvch264', type : 'feature', value : 'auto', description : 'UVC compliant H.264 camera source plugin')
 option('vcd', type : 'feature', value : 'auto', description : 'VCD source plugin')
+option('vdpau', type : 'feature', value : 'auto', description : 'Nvidia VDPAU plugin')
 option('voaacenc', type : 'feature', value : 'auto', description : 'AAC audio encoder plugin')
 option('vulkan', type : 'feature', value : 'auto', description : 'Vulkan video sink plugin')
 option('wasapi', type : 'feature', value : 'auto', description : 'Windows Audio Session API source/sink plugin')
index d22d6ac..01103cf 100644 (file)
@@ -20,7 +20,7 @@ subdir('shm')
 subdir('tinyalsa')
 subdir('uvch264')
 subdir('vcd')
-#subdir('vdpau')
+subdir('vdpau')
 subdir('wasapi')
 subdir('winks')
 subdir('winscreencap')
diff --git a/sys/vdpau/meson.build b/sys/vdpau/meson.build
new file mode 100644 (file)
index 0000000..2cbbfce
--- /dev/null
@@ -0,0 +1,29 @@
+vdpau_sources = [
+  'gstvdpau.c',
+  'gstvdputils.c',
+  'gstvdpvideomemory.c',
+  'gstvdpvideobufferpool.c',
+  'gstvdpdevice.c',
+  'gstvdpdecoder.c',
+  'mpeg/gstvdpmpegdec.c',
+  # 'h264/gsth264dpb.c',
+  # 'h264/gstvdph264dec.c',
+]
+
+vdpau_dep = dependency('vdpau', required: get_option('vdpau'))
+
+if vdpau_dep.found()
+  if x11_dep.found()
+    gstvdpau = library('gstvdpau',
+      vdpau_sources,
+      c_args: gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
+      include_directories: [configinc],
+      dependencies: [gstbase_dep, gstvideo_dep, gstcodecparsers_dep, vdpau_dep, x11_dep, libm],
+      install: true,
+      install_dir: plugins_install_dir,
+    )
+    pkgconfig.generate(gstvdpau, install_dir: plugins_pkgconfig_install_dir)
+  elif get_option('vdpau').enabled()
+    error('vdpau plugin was enabled but required X11 dependency was not found.')
+  endif
+endif