2016-10-13 21:30:43 +00:00
|
|
|
msdk_sources = [
|
|
|
|
'gstmsdk.c',
|
2018-11-23 12:41:57 +00:00
|
|
|
'gstmsdkbufferpool.c',
|
2018-02-13 21:41:28 +00:00
|
|
|
'gstmsdkcontext.c',
|
2018-02-13 22:50:08 +00:00
|
|
|
'gstmsdkcontextutil.c',
|
2016-11-07 20:32:38 +00:00
|
|
|
'gstmsdkdec.c',
|
2018-11-23 12:41:57 +00:00
|
|
|
'gstmsdkdecproputil.c',
|
2016-10-13 21:30:43 +00:00
|
|
|
'gstmsdkenc.c',
|
2016-11-07 20:32:38 +00:00
|
|
|
'gstmsdkh264dec.c',
|
2016-10-13 21:30:43 +00:00
|
|
|
'gstmsdkh264enc.c',
|
2016-11-29 03:14:20 +00:00
|
|
|
'gstmsdkh265dec.c',
|
2016-10-13 21:30:43 +00:00
|
|
|
'gstmsdkh265enc.c',
|
2016-11-22 21:55:00 +00:00
|
|
|
'gstmsdkmjpegdec.c',
|
2016-10-05 22:32:43 +00:00
|
|
|
'gstmsdkmjpegenc.c',
|
2018-01-10 19:40:24 +00:00
|
|
|
'gstmsdkmpeg2dec.c',
|
2016-10-13 21:30:43 +00:00
|
|
|
'gstmsdkmpeg2enc.c',
|
2018-11-23 12:41:57 +00:00
|
|
|
'gstmsdksystemmemory.c',
|
|
|
|
'gstmsdkvc1dec.c',
|
|
|
|
'gstmsdkvideomemory.c',
|
2017-10-30 06:06:32 +00:00
|
|
|
'gstmsdkvp8dec.c',
|
2016-10-13 21:30:43 +00:00
|
|
|
'gstmsdkvp8enc.c',
|
2018-11-23 12:41:57 +00:00
|
|
|
'gstmsdkvpp.c',
|
2018-04-03 18:21:46 +00:00
|
|
|
'gstmsdkvpputil.c',
|
2018-11-23 12:41:57 +00:00
|
|
|
'msdk-enums.c',
|
|
|
|
'msdk.c',
|
|
|
|
]
|
|
|
|
|
2016-11-03 17:47:00 +00:00
|
|
|
if host_machine.system() == 'windows'
|
2018-02-13 22:54:03 +00:00
|
|
|
msdk_sources += ['msdk_d3d.c', 'gstmsdkallocator_d3d.c' ]
|
2016-11-03 17:47:00 +00:00
|
|
|
else
|
2018-02-13 21:43:42 +00:00
|
|
|
msdk_sources += ['msdk_libva.c', 'gstmsdkallocator_libva.c']
|
2016-11-03 17:47:00 +00:00
|
|
|
endif
|
|
|
|
|
2018-10-29 19:51:14 +00:00
|
|
|
have_msdk = false
|
|
|
|
msdk_dep = []
|
|
|
|
|
2018-10-28 14:54:52 +00:00
|
|
|
msdk_option = get_option('msdk')
|
|
|
|
if msdk_option.disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2016-10-13 21:30:43 +00:00
|
|
|
msdk_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip()
|
|
|
|
|
2018-10-28 14:54:52 +00:00
|
|
|
if msdk_root == '' and msdk_option.enabled()
|
|
|
|
error('msdk plugin enabled but Intel Media SDK not found: neither INTELMEDIASDKROOT nor MFX_HOME were set')
|
|
|
|
endif
|
|
|
|
|
2016-10-13 21:30:43 +00:00
|
|
|
if msdk_root != ''
|
2018-11-22 16:02:09 +00:00
|
|
|
msdk_libdir = [msdk_root + '/lib/lin_x64', msdk_root + '/lib/x64', msdk_root + '/lib64', msdk_root + '/lib']
|
2016-10-13 21:30:43 +00:00
|
|
|
msdk_incdir = include_directories(msdk_root + '/include')
|
2018-11-22 16:02:09 +00:00
|
|
|
if cxx.has_header('mfx/mfxdefs.h', args: '-I' + msdk_root + '/include')
|
|
|
|
cdata.set('HAVE_MFX_MFXDEFS_H', 1)
|
|
|
|
endif
|
2018-10-28 14:54:52 +00:00
|
|
|
msdk_lib = cxx.find_library('mfx', dirs: msdk_libdir, required: msdk_option)
|
2016-11-03 17:47:00 +00:00
|
|
|
if host_machine.system() == 'windows'
|
2018-10-28 14:54:52 +00:00
|
|
|
legacy_stdio_dep = cc.find_library('legacy_stdio_definitions', required: msdk_option)
|
|
|
|
d3d11_dep = cc.find_library('d3d11', required: msdk_option)
|
2016-11-03 17:47:00 +00:00
|
|
|
msdk_dep = declare_dependency(include_directories: msdk_incdir, dependencies: [msdk_lib, d3d11_dep, legacy_stdio_dep])
|
|
|
|
msdk_dep_found = msdk_lib.found() and d3d11_dep.found() and legacy_stdio_dep.found() and cc.get_id() == 'msvc'
|
|
|
|
else
|
2018-10-28 14:54:52 +00:00
|
|
|
libva_dep = dependency('libva-drm', required: msdk_option)
|
|
|
|
libdl_dep = cc.find_library('dl', required: msdk_option)
|
|
|
|
libgudev_dep = dependency('gudev-1.0', required: msdk_option)
|
2018-02-13 23:40:22 +00:00
|
|
|
msdk_dep = declare_dependency(include_directories: msdk_incdir, dependencies: [msdk_lib, libva_dep, libdl_dep, libgudev_dep])
|
|
|
|
msdk_dep_found = msdk_lib.found() and libva_dep.found() and libdl_dep.found() and libgudev_dep.found()
|
2016-11-03 17:47:00 +00:00
|
|
|
endif
|
2016-10-13 21:30:43 +00:00
|
|
|
|
2016-11-03 17:47:00 +00:00
|
|
|
if msdk_dep_found
|
2016-10-13 21:30:43 +00:00
|
|
|
gstmsdktag = library('gstmsdk',
|
2018-11-23 16:05:51 +00:00
|
|
|
msdk_sources,
|
2016-10-13 21:30:43 +00:00
|
|
|
c_args : gst_plugins_bad_args,
|
|
|
|
include_directories : [configinc],
|
2018-03-30 19:06:05 +00:00
|
|
|
dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, gstallocators_dep, msdk_dep],
|
2016-10-13 21:30:43 +00:00
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
2018-04-24 18:05:30 +00:00
|
|
|
pkgconfig.generate(gstmsdktag, install_dir : plugins_pkgconfig_install_dir)
|
2018-03-09 23:59:16 +00:00
|
|
|
have_msdk = true
|
2016-10-13 21:30:43 +00:00
|
|
|
endif
|
|
|
|
endif
|