vlc | branch: master | Steve Lhomme <[email protected]> | Wed Jun 5 17:19:30 2019 +0200| [3f86473885871e9940b8eca804bad922cd0fd4b1] | committer: Steve Lhomme
direct3d11: handle the legacy UWP size handling in the local swapchain > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3f86473885871e9940b8eca804bad922cd0fd4b1 --- modules/video_output/win32/d3d11_swapchain.c | 21 +++++++++++++++++++++ modules/video_output/win32/direct3d11.c | 20 -------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/modules/video_output/win32/d3d11_swapchain.c b/modules/video_output/win32/d3d11_swapchain.c index bd4df02897..9d08fbaed6 100644 --- a/modules/video_output/win32/d3d11_swapchain.c +++ b/modules/video_output/win32/d3d11_swapchain.c @@ -62,6 +62,9 @@ typedef struct dxgi_color_space { bool b_full_range; } dxgi_color_space; +DEFINE_GUID(GUID_SWAPCHAIN_WIDTH, 0xf1b59347, 0x1643, 0x411a, 0xad, 0x6b, 0xc7, 0x80, 0x17, 0x7a, 0x06, 0xb6); +DEFINE_GUID(GUID_SWAPCHAIN_HEIGHT, 0x6ea976a0, 0x9d60, 0x4bb7, 0xa5, 0xa9, 0x7d, 0xd1, 0x18, 0x7f, 0xc9, 0xbd); + #define DXGI_COLOR_RANGE_FULL 1 /* 0-255 */ #define DXGI_COLOR_RANGE_STUDIO 0 /* 16-235 */ @@ -486,6 +489,24 @@ bool LocalSwapchainStartEndRendering( void *opaque, bool enter, const libvlc_vid if ( enter ) { +#if VLC_WINSTORE_APP + /* legacy UWP mode, the width/height was set in GUID_SWAPCHAIN_WIDTH/HEIGHT */ + uint32_t i_width; + uint32_t i_height; + UINT dataSize = sizeof(i_width); + HRESULT hr = IDXGISwapChain_GetPrivateData(display->dxgiswapChain, &GUID_SWAPCHAIN_WIDTH, &dataSize, &i_width); + if (SUCCEEDED(hr)) { + dataSize = sizeof(i_height); + hr = IDXGISwapChain_GetPrivateData(display->dxgiswapChain, &GUID_SWAPCHAIN_HEIGHT, &dataSize, &i_height); + if (SUCCEEDED(hr)) { + if (i_width != sys->area.vdcfg.display.width || i_height != sys->area.vdcfg.display.height) + { + vout_display_SetSize(vd, i_width, i_height); + } + } + } +#endif + if ( display->dxgiswapChain4 && p_hdr10 != NULL ) { DXGI_HDR_METADATA_HDR10 hdr10 = { 0 }; diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c index 4ed6b73ca7..a7fe0e259d 100644 --- a/modules/video_output/win32/direct3d11.c +++ b/modules/video_output/win32/direct3d11.c @@ -63,9 +63,6 @@ #include "common.h" #include "../../video_chroma/copy.h" -DEFINE_GUID(GUID_SWAPCHAIN_WIDTH, 0xf1b59347, 0x1643, 0x411a, 0xad, 0x6b, 0xc7, 0x80, 0x17, 0x7a, 0x06, 0xb6); -DEFINE_GUID(GUID_SWAPCHAIN_HEIGHT, 0x6ea976a0, 0x9d60, 0x4bb7, 0xa5, 0xa9, 0x7d, 0xd1, 0x18, 0x7f, 0xc9, 0xbd); - static int Open(vout_display_t *, const vout_display_cfg_t *, video_format_t *, vlc_video_context *); static void Close(vout_display_t *); @@ -779,23 +776,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture, vout_display_sys_t *sys = vd->sys; VLC_UNUSED(date); -#if VLC_WINSTORE_APP - /* legacy UWP mode, the width/height was set in GUID_SWAPCHAIN_WIDTH/HEIGHT */ - uint32_t i_width; - uint32_t i_height; - UINT dataSize = sizeof(i_width); - HRESULT hr = IDXGISwapChain_GetPrivateData(sys->internal_swapchain.dxgiswapChain, &GUID_SWAPCHAIN_WIDTH, &dataSize, &i_width); - if (SUCCEEDED(hr)) { - dataSize = sizeof(i_height); - hr = IDXGISwapChain_GetPrivateData(sys->internal_swapchain.dxgiswapChain, &GUID_SWAPCHAIN_HEIGHT, &dataSize, &i_height); - if (SUCCEEDED(hr)) { - if (i_width != sys->area.vdcfg.display.width || i_height != sys->area.vdcfg.display.height) - { - vout_display_SetSize(vd, i_width, i_height); - } - } - } -#endif libvlc_video_direct3d_hdr10_metadata_t hdr10; if (picture->format.mastering.max_luminance) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
