2 'gstd3d11bufferpool.cpp',
6 'gstd3d11stagingbufferpool.cpp',
10 gstd3d11_dep = dependency('', required : false)
12 if host_system != 'windows'
20 '-DGST_USE_UNSTABLE_API',
21 '-DBUILDING_GST_D3D11',
22 '-DG_LOG_DOMAIN="GStreamer-D3D11"',
25 have_d3d11sdk_h = false
26 have_dxgidebug_h = false
27 d3d11_winapi_app = false
28 d3d11_conf = configuration_data()
30 d3d11_lib = cc.find_library('d3d11', required : false)
31 dxgi_lib = cc.find_library('dxgi', required : false)
32 d3dcompiler_lib = cc.find_library('d3dcompiler', required: false)
33 runtimeobject_lib = cc.find_library('runtimeobject', required : false)
35 if not d3d11_lib.found() or not dxgi_lib.found() or not cc.has_header('d3d11_4.h') or not cc.has_header('dxgi1_6.h')
39 d3d11_winapi_desktop = cxx.compiles('''#include <winapifamily.h>
40 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
43 dependencies: [d3d11_lib, dxgi_lib],
44 name: 'building for Win32')
46 if runtimeobject_lib.found() and d3dcompiler_lib.found()
47 d3d11_winapi_app = cxx.compiles('''#include <winapifamily.h>
48 #include <windows.applicationmodel.core.h>
50 #include <wrl/wrappers/corewrappers.h>
53 #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
57 #error "Windows 10 API is not guaranteed"
59 dependencies: [d3d11_lib, dxgi_lib, runtimeobject_lib],
60 name: 'building for WinRT')
63 if not d3d11_winapi_desktop and not d3d11_winapi_app
67 d3d11_winapi_only_app = d3d11_winapi_app and not d3d11_winapi_desktop
68 d3d11_conf.set10('GST_D3D11_WINAPI_ONLY_APP', d3d11_winapi_only_app)
69 d3d11_conf.set10('GST_D3D11_WINAPI_APP', d3d11_winapi_app)
71 # for enabling debug layer
72 # NOTE: Disable d3d11/dxgi debug layer in case of [UWP build + release CRT]
73 # WACK (Windows App Certification Kit) doesn't seem to be happy with
74 # the DXGIGetDebugInterface1 symbol.
76 # FIXME: Probably DXGIGetDebugInterface1 might be used on UWP app for development
77 # purpose. So, I suspect one possible reason why WACK is complaining about
78 # DXGIGetDebugInterface1 is that debugging APIs couldn't be used for
79 # Windows store app, but couldn't find any reference about that.
82 # https://docs.microsoft.com/en-us/windows/win32/api/dxgidebug/nn-dxgidebug-idxgidebug1
83 # is saying that the IDXGIDebug1 interface is available for both desktop app and
84 # UWP. And then the *DXGIGetDebugInterface1* method need to be called to obtain
85 # the IDXGIDebug1 interface.
87 # [DXGIGetDebugInterface1]
88 # https://docs.microsoft.com/en-us/windows/win32/api/dxgi1_3/nf-dxgi1_3-dxgigetdebuginterface1
89 # is mentioning that DXGIGetDebugInterface1 is desktop app only.
91 # PLEASE LET US KNOW A CORRECT WAY TO OBTAIN IDXGIDebug1 ON UWP, MICROSOFT
92 if get_option('debug') and not (d3d11_winapi_only_app and get_option('b_vscrt') == 'md')
94 ['d3d11sdklayers.h', 'ID3D11Debug', 'ID3D11InfoQueue', 'have_d3d11sdk_h'],
95 ['dxgidebug.h', 'IDXGIDebug', 'IDXGIInfoQueue', 'have_dxgidebug_h'],
98 foreach f : d3d11_debug_libs
106 int main(int arc, char ** argv) {
108 @2@ *info_queue = NULL;
110 }'''.format(header, debug_obj, info_obj)
111 if cc.compiles(compile_code, dependencies: [d3d11_lib, dxgi_lib], name: debug_obj)
112 set_variable(f.get(3), true)
116 message('Disable D3D11Debug and DXGIDebug layers')
119 # don't need to be defined in gstd3d11config.h since it's gstd3d11device internal
121 extra_comm_args += ['-DHAVE_D3D11SDKLAYERS_H']
125 extra_comm_args += ['-DHAVE_DXGIDEBUG_H']
128 # MinGW 32bits compiler seems to be complaining about redundant-decls
129 # when ComPtr is in use. Let's just disable the warning
130 if cc.get_id() != 'msvc'
131 extra_args = cc.get_supported_arguments([
132 '-Wno-redundant-decls',
135 extra_comm_args += extra_args
139 output: 'gstd3d11config.h',
140 configuration: d3d11_conf,
143 pkg_name = 'gstreamer-d3d11-' + api_version
144 gstd3d11 = library('gstd3d11-' + api_version,
146 c_args : gst_plugins_bad_args + extra_c_args + extra_comm_args,
147 cpp_args : gst_plugins_bad_args + extra_comm_args,
148 include_directories : [configinc, libsinc],
149 version : libversion,
150 soversion : soversion,
152 dependencies : [gstbase_dep, gstvideo_dep, gmodule_dep, d3d11_lib, dxgi_lib]
155 library_def = {'lib': gstd3d11}
156 libraries += [[pkg_name, library_def]]
158 # Still non-public api, should not install headers
159 gstd3d11_dep = declare_dependency(link_with : gstd3d11,
160 include_directories : [libsinc],
161 dependencies : [gstbase_dep, gstvideo_dep, d3d11_lib, dxgi_lib])