2023-09-10 14:34:26 +00:00
|
|
|
d3d12_sources = [
|
2023-12-29 15:08:27 +00:00
|
|
|
'gstd3d11on12.cpp',
|
2023-09-15 14:55:14 +00:00
|
|
|
'gstd3d12av1dec.cpp',
|
2023-09-18 09:54:07 +00:00
|
|
|
'gstd3d12basefilter.cpp',
|
2023-09-17 16:31:41 +00:00
|
|
|
'gstd3d12bufferpool.cpp',
|
2023-12-24 06:49:56 +00:00
|
|
|
'gstd3d12commandallocatorpool.cpp',
|
|
|
|
'gstd3d12commandlistpool.cpp',
|
2023-12-25 07:14:39 +00:00
|
|
|
'gstd3d12commandqueue.cpp',
|
2023-12-30 15:29:10 +00:00
|
|
|
'gstd3d12compositor.cpp',
|
2023-12-29 12:22:41 +00:00
|
|
|
'gstd3d12converter-builder.cpp',
|
|
|
|
'gstd3d12converter.cpp',
|
|
|
|
'gstd3d12convert.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'gstd3d12decoder.cpp',
|
2023-12-24 06:49:56 +00:00
|
|
|
'gstd3d12descriptorpool.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'gstd3d12device.cpp',
|
2023-09-18 09:54:07 +00:00
|
|
|
'gstd3d12download.cpp',
|
2024-01-06 12:26:46 +00:00
|
|
|
'gstd3d12dpbstorage.cpp',
|
2024-01-01 16:05:23 +00:00
|
|
|
'gstd3d12dxgicapture.cpp',
|
2024-01-06 12:26:46 +00:00
|
|
|
'gstd3d12encoder.cpp',
|
|
|
|
'gstd3d12encoderbufferpool.cpp',
|
2023-12-28 12:34:17 +00:00
|
|
|
'gstd3d12fencedatapool.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'gstd3d12format.cpp',
|
2024-03-01 17:13:41 +00:00
|
|
|
'gstd3d12graphicscapture.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'gstd3d12h264dec.cpp',
|
2024-01-06 12:26:46 +00:00
|
|
|
'gstd3d12h264enc.cpp',
|
2023-09-15 14:52:34 +00:00
|
|
|
'gstd3d12h265dec.cpp',
|
2024-03-22 10:48:50 +00:00
|
|
|
'gstd3d12ipc.cpp',
|
|
|
|
'gstd3d12ipcclient.cpp',
|
|
|
|
'gstd3d12ipcserver.cpp',
|
|
|
|
'gstd3d12ipcsink.cpp',
|
|
|
|
'gstd3d12ipcsrc.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'gstd3d12memory.cpp',
|
2024-01-24 17:17:36 +00:00
|
|
|
'gstd3d12mpeg2dec.cpp',
|
2023-12-26 08:12:31 +00:00
|
|
|
'gstd3d12overlaycompositor.cpp',
|
2023-12-29 12:22:41 +00:00
|
|
|
'gstd3d12pluginutils.cpp',
|
2024-01-01 16:05:23 +00:00
|
|
|
'gstd3d12screencapture.cpp',
|
|
|
|
'gstd3d12screencapturedevice.cpp',
|
|
|
|
'gstd3d12screencapturesrc.cpp',
|
2023-12-29 15:08:27 +00:00
|
|
|
'gstd3d12testsrc.cpp',
|
2023-12-23 16:05:21 +00:00
|
|
|
'gstd3d12upload.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'gstd3d12utils.cpp',
|
2023-12-26 08:12:31 +00:00
|
|
|
'gstd3d12videosink.cpp',
|
2024-02-10 10:23:25 +00:00
|
|
|
'gstd3d12vp8dec.cpp',
|
2023-09-15 14:53:24 +00:00
|
|
|
'gstd3d12vp9dec.cpp',
|
2023-12-26 08:12:31 +00:00
|
|
|
'gstd3d12window.cpp',
|
2023-09-10 14:34:26 +00:00
|
|
|
'plugin.cpp',
|
|
|
|
]
|
|
|
|
|
2023-12-29 12:22:41 +00:00
|
|
|
hlsl_precompiled = []
|
|
|
|
|
2023-12-13 15:50:01 +00:00
|
|
|
extra_args = [
|
|
|
|
'-DGST_USE_UNSTABLE_API',
|
|
|
|
# Disable this warning error. Otherwise d3dx12.h will break build
|
|
|
|
'/wd4062',
|
|
|
|
]
|
2023-09-10 14:34:26 +00:00
|
|
|
|
|
|
|
d3d12_option = get_option('d3d12')
|
|
|
|
if host_system != 'windows' or d3d12_option.disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-12-13 15:21:00 +00:00
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
if d3d12_option.enabled()
|
|
|
|
error('d3d12 plugin supports only MSVC build')
|
|
|
|
endif
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-09-10 14:34:26 +00:00
|
|
|
d3d12_lib = cc.find_library('d3d12', required : d3d12_option)
|
2023-12-29 15:08:27 +00:00
|
|
|
d3d11_lib = cc.find_library('d3d11', required : d3d12_option)
|
|
|
|
d2d_dep = cc.find_library('d2d1', required: d3d12_option)
|
2023-09-10 14:34:26 +00:00
|
|
|
dxgi_lib = cc.find_library('dxgi', required : d3d12_option)
|
2024-03-01 17:13:41 +00:00
|
|
|
dwmapi_lib = cc.find_library('dwmapi', required: d3d12_option)
|
2023-12-13 15:21:00 +00:00
|
|
|
dx_headers_dep = dependency('DirectX-Headers',
|
|
|
|
version: '>= 1.611',
|
|
|
|
allow_fallback: true,
|
|
|
|
required: d3d12_option)
|
2024-03-23 10:47:34 +00:00
|
|
|
fxc = find_program('fxc', required : d3d12_option)
|
2023-09-10 14:34:26 +00:00
|
|
|
|
2023-12-29 12:22:41 +00:00
|
|
|
if not gstdxva_dep.found() or not d3d12_lib.found() or not dxgi_lib.found() \
|
2024-03-23 10:47:34 +00:00
|
|
|
or not dx_headers_dep.found() or not fxc.found() or not d2d_dep.found() \
|
2024-03-01 17:13:41 +00:00
|
|
|
or not dwmapi_lib.found()
|
2023-09-10 14:34:26 +00:00
|
|
|
if d3d12_option.enabled()
|
2023-12-29 15:08:27 +00:00
|
|
|
error('The d3d12 was enabled explicitly, but required dependencies were not found.')
|
2023-09-10 14:34:26 +00:00
|
|
|
endif
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2024-03-01 17:13:41 +00:00
|
|
|
have_wgc = cxx.compiles('''
|
|
|
|
#include<windows.h>
|
|
|
|
#include<winstring.h>
|
|
|
|
#include<roapi.h>
|
|
|
|
#include<windows.graphics.capture.h>,
|
|
|
|
#include<windows.graphics.capture.interop.h>
|
|
|
|
#include<windows.graphics.directx.direct3d11.h>
|
|
|
|
#include<windows.graphics.directx.direct3d11.interop.h>
|
|
|
|
#include<wrl.h>
|
|
|
|
using namespace Microsoft::WRL;
|
|
|
|
using namespace ABI::Windows::Graphics::Capture;
|
|
|
|
ComPtr<IDirect3D11CaptureFramePoolStatics> pool_statics;
|
|
|
|
ComPtr<IDirect3D11CaptureFramePool> pool;
|
|
|
|
ComPtr<IGraphicsCaptureSession> session;
|
|
|
|
ComPtr<IGraphicsCaptureSession2> session2;
|
|
|
|
ComPtr<IGraphicsCaptureSession3> session3;
|
|
|
|
''',
|
|
|
|
name: 'Windows Graphics Capture support in Windows SDK')
|
|
|
|
|
|
|
|
if not have_wgc
|
|
|
|
if d3d12_option.enabled()
|
|
|
|
error('Windows SDK does not support Windows Graphics Capture')
|
|
|
|
endif
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-09-10 14:34:26 +00:00
|
|
|
d3d12_headers = [
|
|
|
|
'dxgi1_6.h',
|
2023-12-29 15:08:27 +00:00
|
|
|
'd3d11.h',
|
|
|
|
'd3d11on12.h',
|
|
|
|
'd2d1.h',
|
2023-12-29 12:22:41 +00:00
|
|
|
'DirectXMath.h',
|
2023-09-10 14:34:26 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
have_d3d12_headers = true
|
|
|
|
foreach h: d3d12_headers
|
|
|
|
if not cc.has_header(h)
|
|
|
|
have_d3d12_headers = false
|
|
|
|
endif
|
|
|
|
endforeach
|
|
|
|
|
|
|
|
if not have_d3d12_headers
|
|
|
|
if d3d12_option.enabled()
|
|
|
|
error('The d3d12 plugin was enabled explicitly, but required dependencies were not found.')
|
|
|
|
endif
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-12-29 12:22:41 +00:00
|
|
|
hlsl_precompiled = []
|
|
|
|
subdir('hlsl')
|
|
|
|
|
|
|
|
# https://learn.microsoft.com/en-us/windows/win32/dxmath/pg-xnamath-internals#windows-sse-versus-sse2
|
|
|
|
# x86 with Windows 7 or older may not support SSE2
|
|
|
|
if host_machine.cpu_family() != 'x86'
|
|
|
|
extra_args += ['-DHAVE_DIRECTX_MATH_SIMD']
|
|
|
|
endif
|
|
|
|
|
2023-09-10 14:34:26 +00:00
|
|
|
gstd3d12 = library('gstd3d12',
|
2023-12-29 12:22:41 +00:00
|
|
|
d3d12_sources + hlsl_precompiled,
|
2023-09-10 14:34:26 +00:00
|
|
|
c_args : gst_plugins_bad_args + extra_args,
|
|
|
|
cpp_args: gst_plugins_bad_args + extra_args,
|
|
|
|
include_directories : [configinc],
|
2024-03-01 17:13:41 +00:00
|
|
|
dependencies : [gstbase_dep, gstvideo_dep, gstcodecs_dep, gmodule_dep,
|
2023-12-29 15:08:27 +00:00
|
|
|
gstdxva_dep, d3d12_lib, d3d11_lib, d2d_dep, dxgi_lib,
|
2024-03-01 17:13:41 +00:00
|
|
|
dx_headers_dep, dwmapi_lib],
|
2023-09-10 14:34:26 +00:00
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
|
|
|
plugins += [gstd3d12]
|