2 'gstd3d11bufferpool.cpp',
6 'gstd3d11stagingbufferpool.cpp',
10 gstd3d11_dep = dependency('', required : false)
12 d3d11_option = get_option('d3d11')
13 if host_system != 'windows' or d3d11_option.disabled()
22 '-DGST_USE_UNSTABLE_API',
23 '-DBUILDING_GST_D3D11',
24 '-DG_LOG_DOMAIN="GStreamer-D3D11"',
27 have_d3d11sdk_h = false
28 have_dxgidebug_h = false
29 d3d11_winapi_app = false
30 d3d11_conf = configuration_data()
32 d3d11_lib = cc.find_library('d3d11', required : d3d11_option)
33 dxgi_lib = cc.find_library('dxgi', required : d3d11_option)
34 d3dcompiler_lib = cc.find_library('d3dcompiler', required: d3d11_option)
35 runtimeobject_lib = cc.find_library('runtimeobject', required : false)
37 have_d3d11 = d3d11_lib.found() and dxgi_lib.found() and cc.has_header('d3d11_4.h') and cc.has_header('dxgi1_6.h')
39 if d3d11_option.enabled()
40 error('The d3d11 was enabled explicitly, but required dependencies were not found.')
45 d3d11_winapi_desktop = cxx.compiles('''#include <winapifamily.h>
46 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
49 dependencies: [d3d11_lib, dxgi_lib],
50 name: 'building for Win32')
52 if runtimeobject_lib.found() and d3dcompiler_lib.found()
53 d3d11_winapi_app = cxx.compiles('''#include <winapifamily.h>
54 #include <windows.applicationmodel.core.h>
56 #include <wrl/wrappers/corewrappers.h>
59 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
63 #error "Windows 10 API is not guaranteed"
65 dependencies: [d3d11_lib, dxgi_lib, runtimeobject_lib],
66 name: 'building for WinRT')
69 if not d3d11_winapi_desktop and not d3d11_winapi_app
70 error('Neither Desktop partition nor App partition')
73 d3d11_winapi_only_app = d3d11_winapi_app and not d3d11_winapi_desktop
74 d3d11_conf.set10('GST_D3D11_WINAPI_ONLY_APP', d3d11_winapi_only_app)
75 d3d11_conf.set10('GST_D3D11_WINAPI_APP', d3d11_winapi_app)
77 # for enabling debug layer
78 # NOTE: Disable d3d11/dxgi debug layer in case of [UWP build + release CRT]
79 # WACK (Windows App Certification Kit) doesn't seem to be happy with
80 # the DXGIGetDebugInterface1 symbol.
82 # FIXME: Probably DXGIGetDebugInterface1 might be used on UWP app for development
83 # purpose. So, I suspect one possible reason why WACK is complaining about
84 # DXGIGetDebugInterface1 is that debugging APIs couldn't be used for
85 # Windows store app, but couldn't find any reference about that.
88 # https://docs.microsoft.com/en-us/windows/win32/api/dxgidebug/nn-dxgidebug-idxgidebug1
89 # is saying that the IDXGIDebug1 interface is available for both desktop app and
90 # UWP. And then the *DXGIGetDebugInterface1* method need to be called to obtain
91 # the IDXGIDebug1 interface.
93 # [DXGIGetDebugInterface1]
94 # https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_3/nf-dxgi1_3-dxgigetdebuginterface1
95 # is mentioning that DXGIGetDebugInterface1 is desktop app only.
97 # PLEASE LET US KNOW A CORRECT WAY TO OBTAIN IDXGIDebug1 ON UWP, MICROSOFT
98 if get_option('debug') and not (d3d11_winapi_only_app and get_option('b_vscrt') == 'md')
100 ['d3d11sdklayers.h', 'ID3D11Debug', 'ID3D11InfoQueue', 'have_d3d11sdk_h'],
101 ['dxgidebug.h', 'IDXGIDebug', 'IDXGIInfoQueue', 'have_dxgidebug_h'],
104 foreach f : d3d11_debug_libs
112 int main(int arc, char ** argv) {
114 @2@ *info_queue = NULL;
116 }'''.format(header, debug_obj, info_obj)
117 if cc.compiles(compile_code, dependencies: [d3d11_lib, dxgi_lib], name: debug_obj)
118 set_variable(f.get(3), true)
122 message('Disable D3D11Debug and DXGIDebug layers')
125 # don't need to be defined in gstd3d11config.h since it's gstd3d11device internal
127 extra_comm_args += ['-DHAVE_D3D11SDKLAYERS_H']
131 extra_comm_args += ['-DHAVE_DXGIDEBUG_H']
134 # MinGW 32bits compiler seems to be complaining about redundant-decls
135 # when ComPtr is in use. Let's just disable the warning
136 if cc.get_id() != 'msvc'
137 extra_args = cc.get_supported_arguments([
138 '-Wno-redundant-decls',
141 extra_comm_args += extra_args
145 output: 'gstd3d11config.h',
146 configuration: d3d11_conf,
149 pkg_name = 'gstreamer-d3d11-' + api_version
150 gstd3d11 = library('gstd3d11-' + api_version,
152 c_args : gst_plugins_bad_args + extra_c_args + extra_comm_args,
153 cpp_args : gst_plugins_bad_args + extra_comm_args,
154 include_directories : [configinc, libsinc],
155 version : libversion,
156 soversion : soversion,
158 dependencies : [gstbase_dep, gstvideo_dep, gmodule_dep, d3d11_lib, dxgi_lib]
161 library_def = {'lib': gstd3d11}
162 libraries += [[pkg_name, library_def]]
164 # Still non-public api, should not install headers
165 gstd3d11_dep = declare_dependency(link_with : gstd3d11,
166 include_directories : [libsinc],
167 dependencies : [gstbase_dep, gstvideo_dep, gmodule_dep, d3d11_lib, dxgi_lib])