[vlc-commits] Revert "direct3d9: fix the black background when the decoder texture is in YUV"

Hugo Beauzée-Luyssen git at videolan.org
Wed Apr 5 19:31:02 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Fri Mar 31 16:05:00 2017 +0200| [3abd958bfa9214b52b916a73b5a9fae79ba7afc5] | committer: Hugo Beauzée-Luyssen

Revert "direct3d9: fix the black background when the decoder texture is in YUV"

This reverts commit 6b236169c5f1bf6c131f8e7f697552523bcacdd9.

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

 modules/codec/avcodec/dxva2.c          | 12 ------------
 modules/video_output/win32/direct3d9.c | 11 +----------
 2 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index f2ff497..668adbc 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -699,13 +699,6 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
     return err;
 }
 
-static D3DCOLOR GetFormatBlack(D3DFORMAT format)
-{
-    if (vlc_fourcc_IsYUV(format))
-        return D3DCOLOR_XYUV(0,0x80,0x80);
-    return D3DCOLOR_ARGB(0xFF, 0, 0, 0);
-}
-
 /**
  * It creates a DXVA2 decoder using the given video format
  */
@@ -845,11 +838,6 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, const video_format_t
     }
     sys->decoder = (IUnknown*) decoder;
 
-    for (int i = 0; i < sys->surface_count; i++)
-        IDirect3DDevice9_ColorFill((IDirect3DDevice9*) sys->d3ddev,
-                                   (IDirect3DSurface9*) sys->hw_surface[i],
-                                   NULL, GetFormatBlack(p_sys->render));
-
     msg_Dbg(va, "IDirectXVideoDecoderService_CreateVideoDecoder succeed");
     return VLC_SUCCESS;
 }
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index ae0c693..f190e65 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -334,13 +334,6 @@ static void DestroyPicture(picture_t *picture)
     free(picture);
 }
 
-static D3DCOLOR GetFormatBlack(D3DFORMAT format)
-{
-    if (vlc_fourcc_IsYUV(format))
-        return D3DCOLOR_XYUV(0,0x80,0x80);
-    return D3DCOLOR_ARGB(0xFF, 0, 0, 0);
-}
-
 /* */
 static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
 {
@@ -374,8 +367,6 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
            goto error;
         }
 
-        IDirect3DDevice9_ColorFill(vd->sys->d3ddev, picsys->surface, NULL, GetFormatBlack(format));
-
         picture_resource_t resource = {
             .p_sys = picsys,
             .pf_destroy = DestroyPicture,
@@ -1169,7 +1160,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, video_format_t *fmt)
 #endif
 
     /* fill surface with black color */
-    IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, GetFormatBlack(d3dfmt->format));
+    IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0));
 
     /* Create the associated picture */
     picture_sys_t *picsys = malloc(sizeof(*picsys));



More information about the vlc-commits mailing list