mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
meson: d3d11: Add d3d11-wgc option for Windows Graphics Capture feature
Make the feature requirement explicitly controllable via build option Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4939>
This commit is contained in:
parent
c6a7c88fd9
commit
6429f04692
2 changed files with 29 additions and 20 deletions
|
@ -99,6 +99,7 @@ option('curl', type : 'feature', value : 'auto', description : 'cURL network sou
|
||||||
option('curl-ssh2', type : 'feature', value : 'auto', description : 'cURL network source and sink plugin libssh2 support')
|
option('curl-ssh2', type : 'feature', value : 'auto', description : 'cURL network source and sink plugin libssh2 support')
|
||||||
option('d3dvideosink', type : 'feature', value : 'auto', description : 'Direct3D video sink plugin')
|
option('d3dvideosink', type : 'feature', value : 'auto', description : 'Direct3D video sink plugin')
|
||||||
option('d3d11', type : 'feature', value : 'auto', description : 'Direct3D11 plugin')
|
option('d3d11', type : 'feature', value : 'auto', description : 'Direct3D11 plugin')
|
||||||
|
option('d3d11-wgc', type : 'feature', value : 'auto', description : 'Windows Graphics Capture API support in d3d11 plugin')
|
||||||
option('dash', type : 'feature', value : 'auto', description : 'DASH demuxer plugin')
|
option('dash', type : 'feature', value : 'auto', description : 'DASH demuxer plugin')
|
||||||
option('dc1394', type : 'feature', value : 'auto', description : 'libdc1394 IIDC camera source plugin')
|
option('dc1394', type : 'feature', value : 'auto', description : 'libdc1394 IIDC camera source plugin')
|
||||||
option('decklink', type : 'feature', value : 'auto', description : 'DeckLink audio/video source/sink plugin')
|
option('decklink', type : 'feature', value : 'auto', description : 'DeckLink audio/video source/sink plugin')
|
||||||
|
|
|
@ -32,6 +32,7 @@ extra_args = ['-DGST_USE_UNSTABLE_API']
|
||||||
extra_dep = []
|
extra_dep = []
|
||||||
|
|
||||||
d3d11_option = get_option('d3d11')
|
d3d11_option = get_option('d3d11')
|
||||||
|
d3d11_wgc_option = get_option('d3d11-wgc')
|
||||||
if host_system != 'windows' or d3d11_option.disabled()
|
if host_system != 'windows' or d3d11_option.disabled()
|
||||||
subdir_done()
|
subdir_done()
|
||||||
endif
|
endif
|
||||||
|
@ -55,26 +56,34 @@ endif
|
||||||
|
|
||||||
d2d_dep = cc.find_library('d2d1', required: d3d11_option)
|
d2d_dep = cc.find_library('d2d1', required: d3d11_option)
|
||||||
have_d2d_h = cc.has_header('d2d1.h', required: d3d11_option)
|
have_d2d_h = cc.has_header('d2d1.h', required: d3d11_option)
|
||||||
|
dwmapi_lib = cc.find_library('dwmapi', required: d3d11_wgc_option)
|
||||||
|
have_wgc = false
|
||||||
|
|
||||||
have_wgc = cxx.compiles('''
|
if not d3d11_wgc_option.disabled()
|
||||||
#include<windows.h>
|
have_wgc = cxx.compiles('''
|
||||||
#include<winstring.h>
|
#include<windows.h>
|
||||||
#include<roapi.h>
|
#include<winstring.h>
|
||||||
#include<windows.graphics.capture.h>,
|
#include<roapi.h>
|
||||||
#include<windows.graphics.capture.interop.h>
|
#include<windows.graphics.capture.h>,
|
||||||
#include<windows.graphics.directx.direct3d11.h>
|
#include<windows.graphics.capture.interop.h>
|
||||||
#include<windows.graphics.directx.direct3d11.interop.h>
|
#include<windows.graphics.directx.direct3d11.h>
|
||||||
#include<wrl.h>
|
#include<windows.graphics.directx.direct3d11.interop.h>
|
||||||
using namespace Microsoft::WRL;
|
#include<wrl.h>
|
||||||
using namespace ABI::Windows::Graphics::Capture;
|
using namespace Microsoft::WRL;
|
||||||
ComPtr<IDirect3D11CaptureFramePoolStatics> pool_statics;
|
using namespace ABI::Windows::Graphics::Capture;
|
||||||
ComPtr<IDirect3D11CaptureFramePoolStatics2> pool_statics2;
|
ComPtr<IDirect3D11CaptureFramePoolStatics> pool_statics;
|
||||||
ComPtr<IDirect3D11CaptureFramePool> pool;
|
ComPtr<IDirect3D11CaptureFramePoolStatics2> pool_statics2;
|
||||||
ComPtr<IGraphicsCaptureSession> session;
|
ComPtr<IDirect3D11CaptureFramePool> pool;
|
||||||
ComPtr<IGraphicsCaptureSession2> session2;
|
ComPtr<IGraphicsCaptureSession> session;
|
||||||
ComPtr<IGraphicsCaptureSession3> session3;
|
ComPtr<IGraphicsCaptureSession2> session2;
|
||||||
''',
|
ComPtr<IGraphicsCaptureSession3> session3;
|
||||||
name: 'Windows Graphics Capture support in Windows SDK')
|
''',
|
||||||
|
name: 'Windows Graphics Capture support in Windows SDK')
|
||||||
|
|
||||||
|
if d3d11_wgc_option.enabled() and not have_wgc
|
||||||
|
error('The Windows Graphics Capture feature is enabled but not supported by Windows SDK')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# if build target is Windows 10 and WINAPI_PARTITION_APP is allowed,
|
# if build target is Windows 10 and WINAPI_PARTITION_APP is allowed,
|
||||||
# we can build UWP only modules as well
|
# we can build UWP only modules as well
|
||||||
|
@ -97,7 +106,6 @@ if d3d11_winapi_desktop
|
||||||
extra_dep += [winmm_lib]
|
extra_dep += [winmm_lib]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
dwmapi_lib = cc.find_library('dwmapi', required: false)
|
|
||||||
if have_wgc and dwmapi_lib.found()
|
if have_wgc and dwmapi_lib.found()
|
||||||
d3d11_sources += ['gstd3d11winrtcapture.cpp']
|
d3d11_sources += ['gstd3d11winrtcapture.cpp']
|
||||||
extra_args += ['-DHAVE_WINRT_CAPTURE']
|
extra_args += ['-DHAVE_WINRT_CAPTURE']
|
||||||
|
|
Loading…
Reference in a new issue