[vlc-commits] d3d9_fmt: don't specify the D3DFORMAT to use with the IDirect3DDevice9

Steve Lhomme git at videolan.org
Wed Mar 4 16:06:44 CET 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar  3 09:27:00 2020 +0100| [87950708de0a549b6ad5079b1d494ec9760535e5] | committer: Steve Lhomme

d3d9_fmt: don't specify the D3DFORMAT to use with the IDirect3DDevice9

It will be automatically filled when creating the device and we don't use the
value anymore anyway.

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

 modules/video_chroma/d3d9_fmt.c | 29 ++++-------------------------
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/modules/video_chroma/d3d9_fmt.c b/modules/video_chroma/d3d9_fmt.c
index 8c72801dde..a837fdff85 100644
--- a/modules/video_chroma/d3d9_fmt.c
+++ b/modules/video_chroma/d3d9_fmt.c
@@ -56,18 +56,8 @@ typedef struct {
  * It setup vout_display_sys_t::d3dpp and vout_display_sys_t::rect_display
  * from the default adapter.
  */
-static HRESULT FillPresentationParameters(const d3d9_decoder_device_t *dec_dev,
-                                    D3DPRESENT_PARAMETERS *d3dpp)
+static void FillPresentationParameters(D3DPRESENT_PARAMETERS *d3dpp)
 {
-    /*
-    ** Get the current desktop display mode, so we can set up a back
-    ** buffer of the same format
-    */
-    D3DDISPLAYMODE d3ddm;
-    HRESULT hr = IDirect3D9_GetAdapterDisplayMode(dec_dev->hd3d.obj, dec_dev->d3ddev.adapterId, &d3ddm);
-    if (FAILED(hr))
-        return hr;
-
     /* Set up the structure used to create the D3DDevice. */
     ZeroMemory(d3dpp, sizeof(D3DPRESENT_PARAMETERS));
     d3dpp->Flags                  = D3DPRESENTFLAG_VIDEO;
@@ -77,22 +67,15 @@ static HRESULT FillPresentationParameters(const d3d9_decoder_device_t *dec_dev,
     d3dpp->EnableAutoDepthStencil = FALSE;
     d3dpp->hDeviceWindow          = NULL;
     d3dpp->SwapEffect             = D3DSWAPEFFECT_COPY;
-    d3dpp->BackBufferFormat       = d3ddm.Format;
     d3dpp->BackBufferCount        = 1;
     d3dpp->BackBufferWidth        = GetSystemMetrics(SM_CXVIRTUALSCREEN);
     d3dpp->BackBufferHeight       = GetSystemMetrics(SM_CYVIRTUALSCREEN);
-
-    return D3D_OK;
 }
 
 int D3D9_ResetDevice(vlc_object_t *o, d3d9_decoder_device_t *dec_dev)
 {
     D3DPRESENT_PARAMETERS d3dpp;
-    if (FAILED(FillPresentationParameters(dec_dev, &d3dpp)))
-    {
-        msg_Err(o, "Could not get presentation parameters to reset device");
-        return VLC_EGENERIC;
-    }
+    FillPresentationParameters(&d3dpp);
 
     /* */
     HRESULT hr;
@@ -261,13 +244,9 @@ d3d9_handle_t *hd3d = &sys->dec_device.hd3d;
     }
 
     out->adapterId = AdapterToUse;
-    /* TODO only create a device for the decoder dimensions */
+
     D3DPRESENT_PARAMETERS d3dpp;
-    if (FAILED(FillPresentationParameters(&sys->dec_device, &d3dpp)))
-    {
-        msg_Err(o, "Could not get presentation parameters");
-        goto error;
-    }
+    FillPresentationParameters(&d3dpp);
 
     /* */
     if (FAILED(IDirect3D9_GetAdapterIdentifier(hd3d->obj, AdapterToUse,0, &out->identifier))) {



More information about the vlc-commits mailing list