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