[vlc-commits] direct3d11: initialize the swapchain with the window/display size

Steve Lhomme git at videolan.org
Tue Apr 30 16:24:12 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Apr 18 16:45:09 2019 +0200| [9c72159c75496c5d0080fa7ec302e6584b1facaf] | committer: Steve Lhomme

direct3d11: initialize the swapchain with the window/display size

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c72159c75496c5d0080fa7ec302e6584b1facaf
---

 modules/video_output/win32/direct3d11.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index d8b890045c..30e7cab67d 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -285,15 +285,15 @@ static void Swap(void *opaque)
 }
 
 #if !VLC_WINSTORE_APP
-static void FillSwapChainDesc(vout_display_t *vd, DXGI_SWAP_CHAIN_DESC1 *out)
+static void FillSwapChainDesc(vout_display_t *vd, UINT width, UINT height, DXGI_SWAP_CHAIN_DESC1 *out)
 {
     ZeroMemory(out, sizeof(*out));
     out->BufferCount = 3;
     out->BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
     out->SampleDesc.Count = 1;
     out->SampleDesc.Quality = 0;
-    out->Width = vd->source.i_visible_width;
-    out->Height = vd->source.i_visible_height;
+    out->Width = width;
+    out->Height = height;
     out->Format = vd->sys->display.pixelFormat->formatTexture;
     //out->Flags = 512; // DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO;
 
@@ -318,7 +318,7 @@ static void FillSwapChainDesc(vout_display_t *vd, DXGI_SWAP_CHAIN_DESC1 *out)
     }
 }
 
-static int SetupWindowedOutput(vout_display_t *vd)
+static int SetupWindowedOutput(vout_display_t *vd, UINT width, UINT height)
 {
     vout_display_sys_t *sys = vd->sys;
 
@@ -346,7 +346,7 @@ static int SetupWindowedOutput(vout_display_t *vd)
         return VLC_EGENERIC;
     }
 
-    FillSwapChainDesc(vd, &scd);
+    FillSwapChainDesc(vd, width, height, &scd);
 
     IDXGIAdapter *dxgiadapter = D3D11DeviceAdapter(sys->d3d_dev.d3ddevice);
     if (unlikely(dxgiadapter==NULL)) {
@@ -1183,7 +1183,7 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmtp)
         ret = SetupWindowLessOutput(vd);
 #if !VLC_WINSTORE_APP
     else
-        ret = SetupWindowedOutput(vd);
+        ret = SetupWindowedOutput(vd, sys->area.vdcfg.display.width, sys->area.vdcfg.display.height);
 #endif /* !VLC_WINSTORE_APP */
     if (ret != VLC_SUCCESS)
         return ret;



More information about the vlc-commits mailing list