qsv: Update SDK version to v2022.2.4
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / qsv / meson.build
1 qsv_sources = [
2   'gstqsvallocator.cpp',
3   'gstqsvav1enc.cpp',
4   'gstqsvdecoder.cpp',
5   'gstqsvencoder.cpp',
6   'gstqsvh264dec.cpp',
7   'gstqsvh264enc.cpp',
8   'gstqsvh265dec.cpp',
9   'gstqsvh265enc.cpp',
10   'gstqsvjpegenc.cpp',
11   'gstqsvutils.cpp',
12   'gstqsvvp9enc.cpp',
13   'plugin.cpp',
14 ]
15
16 qsv_d3d11_sources = [
17   'gstqsvallocator_d3d11.cpp',
18 ]
19
20 qsv_va_sources = [
21   'gstqsvallocator_va.cpp',
22 ]
23
24 extra_args = [
25   '-DGST_USE_UNSTABLE_API',
26 ]
27
28 qsv_option = get_option('qsv')
29 if qsv_option.disabled()
30   subdir_done()
31 endif
32
33 qsv_platform_deps = []
34 if host_system == 'windows'
35   # TODO: We can cross-compile this plugin using MinGW but there's an issue.
36   # Re-enable cross-compile once it's investigated and addressed
37   # https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/854
38   if cc.get_id() != 'msvc'
39     if qsv_option.enabled()
40       error('qsv plugin supports only MSVC build')
41     else
42       subdir_done()
43     endif
44   endif
45
46   if not gstd3d11_dep.found()
47     if qsv_option.enabled()
48       error('The qsv was enabled explicitly, but required d3d11 was not found')
49     else
50       subdir_done()
51     endif
52   endif
53
54   code = '''
55   #include <windows.h>
56   #if !(WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP))
57   #error "Not building for UWP"
58   #endif'''
59   if cc.compiles(code, name : 'building for UWP')
60     if qsv_option.enabled()
61       error('qsv plugin does not support UWP')
62     else
63       subdir_done()
64     endif
65   endif
66
67   qsv_sources += qsv_d3d11_sources
68   qsv_platform_deps += [gstd3d11_dep]
69 elif host_system == 'linux' and host_machine.cpu_family() == 'x86_64'
70   if not gstva_dep.found()
71     if qsv_option.enabled()
72       error('The qsv was enabled explicitly, but required va was not found')
73     else
74       subdir_done()
75     endif
76   endif
77   qsv_sources += qsv_va_sources
78   qsv_platform_deps += [gstva_dep]
79 else
80   if qsv_option.enabled()
81     error('QSV plugin supports only Windows or Linux')
82   else
83     subdir_done()
84   endif
85 endif
86
87 # suppress deprecated use of MFXInitEx. We don't use the method,
88 # but used in "mfxvideo++.h"
89 # and MinGW 32bits compiler seems to be complaining about redundant-decls
90 if cc.get_id() != 'msvc'
91   extra_args += cc.get_supported_arguments([
92     '-Wno-redundant-decls',
93     '-Wno-deprecated-declarations',
94   ])
95 endif
96
97 subdir('libmfx')
98
99 gstqsv = library('gstqsv',
100   qsv_sources,
101   c_args : gst_plugins_bad_args + extra_args,
102   cpp_args : gst_plugins_bad_args + extra_args,
103   include_directories : [configinc],
104   dependencies : [gstbase_dep, gstvideo_dep, gstcodecparsers_dep, libmfx_internal_dep] + qsv_platform_deps,
105   install : true,
106   install_dir : plugins_install_dir,
107 )
108
109 plugins += [gstqsv]