d3d11compositor: Performance optimization
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / d3d11 / meson.build
1 d3d11_sources = [
2   'gstd3d11av1dec.cpp',
3   'gstd3d11basefilter.cpp',
4   'gstd3d11compositor.cpp',
5   'gstd3d11convert.cpp',
6   'gstd3d11converter.cpp',
7   'gstd3d11decoder.cpp',
8   'gstd3d11deinterlace.cpp',
9   'gstd3d11download.cpp',
10   'gstd3d11h264dec.cpp',
11   'gstd3d11h265dec.cpp',
12   'gstd3d11mpeg2dec.cpp',
13   'gstd3d11overlaycompositor.cpp',
14   'gstd3d11pluginutils.cpp',
15   'gstd3d11shader.cpp',
16   'gstd3d11testsrc.cpp',
17   'gstd3d11upload.cpp',
18   'gstd3d11videoprocessor.cpp',
19   'gstd3d11videosink.cpp',
20   'gstd3d11vp8dec.cpp',
21   'gstd3d11vp9dec.cpp',
22   'gstd3d11window.cpp',
23   'gstd3d11window_dummy.cpp',
24   'plugin.cpp',
25 ]
26
27 extra_c_args = ['-DCOBJMACROS']
28 extra_args = ['-DGST_USE_UNSTABLE_API']
29 extra_dep = []
30
31 d3d11_option = get_option('d3d11')
32 if host_system != 'windows' or d3d11_option.disabled()
33   subdir_done()
34 endif
35
36 if not gstd3d11_dep.found() or not cc.has_header('dxva.h') or not cc.has_header('d3d9.h') or not cc.has_header('d3dcompiler.h')
37   if d3d11_option.enabled()
38     error('The d3d11 was enabled explicitly, but required dependencies were not found.')
39   endif
40   subdir_done()
41 endif
42
43 d3dcompiler_lib = cc.find_library('d3dcompiler', required: d3d11_option)
44 runtimeobject_lib = cc.find_library('runtimeobject', required : false)
45 winmm_lib = cc.find_library('winmm', required: false)
46
47 if d3d11_winapi_only_app and (not d3dcompiler_lib.found() or not runtimeobject_lib.found())
48   if d3d11_option.enabled()
49     error('The d3d11 plugin was enabled explicitly, but required dependencies were not found.')
50   endif
51   subdir_done()
52 endif
53
54 # if build target is Windows 10 and WINAPI_PARTITION_APP is allowed,
55 # we can build UWP only modules as well
56 if d3d11_winapi_app
57   d3d11_sources += ['gstd3d11window_corewindow.cpp',
58                     'gstd3d11window_swapchainpanel.cpp']
59   extra_dep += [runtimeobject_lib, d3dcompiler_lib]
60 endif
61
62 if d3d11_winapi_desktop
63   d3d11_sources += ['gstd3d11window_win32.cpp']
64   d3d11_sources += ['gstd3d11screencapture.cpp',
65                     'gstd3d11screencapturedevice.cpp',
66                     'gstd3d11screencapturesrc.cpp']
67
68   # multimedia clock is desktop only API
69   if winmm_lib.found() and cc.has_header('mmsystem.h')
70     extra_args += ['-DHAVE_WINMM']
71     extra_dep += [winmm_lib]
72   endif
73 endif
74
75 # MinGW 32bits compiler seems to be complaining about redundant-decls
76 # when ComPtr is in use. Let's just disable the warning
77 if cc.get_id() != 'msvc'
78   extra_mingw_args = cc.get_supported_arguments([
79     '-Wno-redundant-decls',
80   ])
81
82   extra_args += extra_mingw_args
83 endif
84
85 gstd3d11 = library('gstd3d11',
86   d3d11_sources,
87   c_args : gst_plugins_bad_args + extra_c_args + extra_args,
88   cpp_args: gst_plugins_bad_args + extra_args,
89   include_directories : [configinc],
90   dependencies : [gstbase_dep, gstvideo_dep, gmodule_dep, gstcontroller_dep, gstd3d11_dep, gstcodecs_dep] + extra_dep,
91   install : true,
92   install_dir : plugins_install_dir,
93 )
94 pkgconfig.generate(gstd3d11, install_dir : plugins_pkgconfig_install_dir)
95 plugins += [gstd3d11]