meson: add build files for msdk
authorScott D Phillips <scott.d.phillips@intel.com>
Thu, 13 Oct 2016 21:30:43 +0000 (14:30 -0700)
committerJosep Torra <n770galaxy@gmail.com>
Mon, 14 Nov 2016 14:17:30 +0000 (15:17 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=770990

sys/meson.build
sys/msdk/meson.build [new file with mode: 0644]

index 403fd2b0b3e2f85e258a225531b4dce2ff18a282..c42715c5d2d20caac3524dd02997c9ec1283e477 100644 (file)
@@ -16,6 +16,7 @@ subdir('dvb')
 #subdir('dxr3')
 #subdir('fbdev')
 #subdir('linsys')
+subdir('msdk')
 #subdir('nvenc')
 #subdir('opensles')
 #subdir('pvr2d')
diff --git a/sys/msdk/meson.build b/sys/msdk/meson.build
new file mode 100644 (file)
index 0000000..b7e7661
--- /dev/null
@@ -0,0 +1,32 @@
+msdk_sources = [
+  'gstmsdk.c',
+  'gstmsdkenc.c',
+  'gstmsdkh264enc.c',
+  'gstmsdkh265enc.c',
+  'gstmsdkmpeg2enc.c',
+  'gstmsdkvp8enc.c',
+  'msdk_libva.c',
+]
+
+python3 = find_program('python3')
+msdk_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip()
+
+if msdk_root != ''
+  msdk_libdir = msdk_root + '/lib/lin_x64'
+  msdk_incdir = include_directories(msdk_root + '/include')
+  msdk_lib = cc.find_library('mfx', dirs: msdk_libdir, required: false)
+  libva_dep = dependency('libva-drm', required: false)
+  libdl_dep = cc.find_library('dl', required: false)
+  msdk_dep = declare_dependency(include_directories: msdk_incdir, dependencies: [msdk_lib, libva_dep, libdl_dep])
+
+  if msdk_lib.found() and libva_dep.found() and libdl_dep.found()
+    gstmsdktag = library('gstmsdk',
+      msdk_sources,
+      c_args : gst_plugins_bad_args,
+      include_directories : [configinc],
+      dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, msdk_dep],
+      install : true,
+      install_dir : plugins_install_dir,
+    )
+  endif
+endif