[vlc-commits] d3d9_fmt: the backbuffer is always effectively the display size

Steve Lhomme git at videolan.org
Wed Jun 26 12:06:23 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun 26 10:59:30 2019 +0200| [cf19f9604861e28c5f56014e560f072c23dd7b40] | committer: Steve Lhomme

d3d9_fmt: the backbuffer is always effectively the display size

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

 modules/video_chroma/d3d9_fmt.c        | 9 +++------
 modules/video_chroma/d3d9_fmt.h        | 2 +-
 modules/video_output/win32/direct3d9.c | 2 +-
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/modules/video_chroma/d3d9_fmt.c b/modules/video_chroma/d3d9_fmt.c
index 2d280d8c49..56c5488126 100644
--- a/modules/video_chroma/d3d9_fmt.c
+++ b/modules/video_chroma/d3d9_fmt.c
@@ -84,7 +84,7 @@ HRESULT D3D9_CreateDevice(vlc_object_t *o, d3d9_handle_t *hd3d, HWND hwnd,
     out->hwnd      = hwnd;
     /* TODO only create a device for the decoder dimensions */
     D3DPRESENT_PARAMETERS d3dpp;
-    if (D3D9_FillPresentationParameters(hd3d, source, out, &d3dpp))
+    if (D3D9_FillPresentationParameters(hd3d, out, &d3dpp))
     {
         msg_Err(o, "Could not presentation parameters");
         return E_INVALIDARG;
@@ -172,7 +172,6 @@ void D3D9_ReleaseDevice(d3d9_device_t *d3d_dev)
  * from the default adapter.
  */
 int D3D9_FillPresentationParameters(d3d9_handle_t *hd3d,
-                                    const video_format_t *source,
                                     const d3d9_device_t *out,
                                     D3DPRESENT_PARAMETERS *d3dpp)
 {
@@ -196,10 +195,8 @@ int D3D9_FillPresentationParameters(d3d9_handle_t *hd3d,
     d3dpp->SwapEffect             = D3DSWAPEFFECT_COPY;
     d3dpp->BackBufferFormat       = d3ddm.Format;
     d3dpp->BackBufferCount        = 1;
-    d3dpp->BackBufferWidth        = __MAX((unsigned int)GetSystemMetrics(SM_CXVIRTUALSCREEN),
-                                            source->i_width);
-    d3dpp->BackBufferHeight       = __MAX((unsigned int)GetSystemMetrics(SM_CYVIRTUALSCREEN),
-                                            source->i_height);
+    d3dpp->BackBufferWidth        = GetSystemMetrics(SM_CXVIRTUALSCREEN);
+    d3dpp->BackBufferHeight       = GetSystemMetrics(SM_CYVIRTUALSCREEN);
 
     return VLC_SUCCESS;
 }
diff --git a/modules/video_chroma/d3d9_fmt.h b/modules/video_chroma/d3d9_fmt.h
index bd688f4bdd..968d103b69 100644
--- a/modules/video_chroma/d3d9_fmt.h
+++ b/modules/video_chroma/d3d9_fmt.h
@@ -109,6 +109,6 @@ int D3D9_CreateExternal(vlc_object_t *, d3d9_handle_t *, IDirect3DDevice9 *);
 
 void D3D9_Destroy(d3d9_handle_t *);
 
-int D3D9_FillPresentationParameters(d3d9_handle_t *, const video_format_t *, const d3d9_device_t *, D3DPRESENT_PARAMETERS *);
+int D3D9_FillPresentationParameters(d3d9_handle_t *, const d3d9_device_t *, D3DPRESENT_PARAMETERS *);
 
 #endif /* VLC_VIDEOCHROMA_D3D9_FMT_H_ */
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 8f7ecb5ee3..fb7cc6916c 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -941,7 +941,7 @@ static int Direct3D9Reset(vout_display_t *vd, video_format_t *fmtp)
     d3d9_device_t *p_d3d9_dev = &sys->d3d_dev;
 
     D3DPRESENT_PARAMETERS d3dpp;
-    if (D3D9_FillPresentationParameters(&sys->hd3d, &vd->source, p_d3d9_dev, &d3dpp))
+    if (D3D9_FillPresentationParameters(&sys->hd3d, p_d3d9_dev, &d3dpp))
     {
         msg_Err(vd, "Could not presentation parameters to reset device");
         return VLC_EGENERIC;



More information about the vlc-commits mailing list