[vlc-commits] direct3d11: fix display size legacy UWP mode
Steve Lhomme
git at videolan.org
Tue Apr 30 11:14:00 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Apr 16 08:41:26 2019 +0200| [bd43fa7ae8601149d4cbac750f97566f8f294890] | committer: Steve Lhomme
direct3d11: fix display size legacy UWP mode
Implement the TODO: call a DISPLAY_CHANGE_DISPLAY_SIZE when we detect the
external swapchain dimensions have changed.
We don't need a special callback to read the "display" dimensions.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bd43fa7ae8601149d4cbac750f97566f8f294890
---
modules/video_output/win32/direct3d11.c | 48 +++++++++++----------------------
1 file changed, 15 insertions(+), 33 deletions(-)
diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 1b05f72163..081b6c8510 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -157,28 +157,6 @@ static void UpdatePicQuadPosition(vout_display_t *);
static int Control(vout_display_t *, int, va_list);
-#if VLC_WINSTORE_APP
-static bool GetExtenalSwapchainDimensions(void *opaque, UINT *width, UINT *height)
-{
- const vout_display_sys_t *sys = opaque;
- uint32_t i_width;
- uint32_t i_height;
- UINT dataSize = sizeof(i_width);
- HRESULT hr = IDXGISwapChain_GetPrivateData(sys->dxgiswapChain, &GUID_SWAPCHAIN_WIDTH, &dataSize, &i_width);
- if (FAILED(hr)) {
- return false;
- }
- dataSize = sizeof(i_height);
- hr = IDXGISwapChain_GetPrivateData(sys->dxgiswapChain, &GUID_SWAPCHAIN_HEIGHT, &dataSize, &i_height);
- if (FAILED(hr)) {
- return false;
- }
- *width = i_width;
- *height = i_height;
- return true;
-}
-#endif
-
static HRESULT UpdateBackBuffer(vout_display_t *vd)
{
vout_display_sys_t *sys = vd->sys;
@@ -468,9 +446,6 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR))
goto error;
}
-#else /* !VLC_WINSTORE_APP */
- sys->area.pf_GetDisplayDimensions = GetExtenalSwapchainDimensions;
- sys->area.opaque_dimensions = sys;
#endif /* !VLC_WINSTORE_APP */
if (vd->source.projection_mode != PROJECTION_MODE_RECTANGULAR && sys->sys.hvideownd)
@@ -909,15 +884,22 @@ static void Prepare(vout_display_t *vd, picture_t *picture,
VLC_UNUSED(date);
#if VLC_WINSTORE_APP
- /* TODO read the swapchain size and call VOUT_DISPLAY_CHANGE_DISPLAY_SIZE */
- UpdateRects(VLC_OBJECT(vd), &sys->area, &sys->sys);
-#endif
-
- if ( sys->area.place_changed )
- {
- UpdateSize(vd);
- sys->area.place_changed =false;
+ /* 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->dxgiswapChain, &GUID_SWAPCHAIN_WIDTH, &dataSize, &i_width);
+ if (SUCCEEDED(hr)) {
+ dataSize = sizeof(i_height);
+ hr = IDXGISwapChain_GetPrivateData(sys->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 (sys->starRenderCb(sys->outside_opaque))
{
More information about the vlc-commits
mailing list