-mfx_dep = dependency('libmfx', required: false)
-if mfx_dep.found()
- mfx_incdir = mfx_dep.get_pkgconfig_variable('includedir')
- mfx_inc = []
-else
- # Old versions of MediaSDK don't provide a pkg-config file
- mfx_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip()
-
- if mfx_root != ''
- mfx_libdir = [mfx_root + '/lib/lin_x64', mfx_root + '/lib/x64', mfx_root + '/lib64', mfx_root + '/lib']
- if host_machine.system() == 'windows'
- if host_machine.cpu_family() == 'x86'
- mfx_libdir = [mfx_root + '/lib/win32']
- else
- mfx_libdir = [mfx_root + '/lib/x64']
+mfx_api = get_option('mfx_api')
+
+if mfx_api != 'oneVPL'
+ mfx_dep = dependency('libmfx', version: ['>= 1.0', '<= 1.99'], required: false)
+
+ if mfx_dep.found()
+ mfx_incdir = mfx_dep.get_pkgconfig_variable('includedir')
+ mfx_inc = []
+ use_msdk = true
+ else
+ # Old versions of MediaSDK don't provide a pkg-config file
+ mfx_root = run_command(python3, '-c', 'import os; print(os.environ.get("INTELMEDIASDKROOT", os.environ.get("MFX_HOME", "")))').stdout().strip()
+
+ if mfx_root != ''
+ mfx_libdir = [mfx_root + '/lib/lin_x64', mfx_root + '/lib/x64', mfx_root + '/lib64', mfx_root + '/lib']
+ if host_machine.system() == 'windows'
+ if host_machine.cpu_family() == 'x86'
+ mfx_libdir = [mfx_root + '/lib/win32']
+ else
+ mfx_libdir = [mfx_root + '/lib/x64']
+ endif