[vlc-devel] [PATCH] direct3d9: fix the black background when the decoder texture is in YUV

Steve Lhomme robux4 at videolabs.io
Wed Mar 22 14:09:11 CET 2017


fixes the bottom line issue in #17420

--
replaces https://patches.videolan.org/patch/16082/
* missing YUV black for the DXVA2 pool
---
 modules/video_output/win32/direct3d9.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index f190e65147..f62343c0ef 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -367,6 +367,12 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned count)
            goto error;
         }
 
+        /* fill surface with black color */
+        if (vlc_fourcc_IsYUV(format))
+            IDirect3DDevice9_ColorFill(vd->sys->d3ddev, picsys->surface, NULL, D3DCOLOR_XYUV(0,0x80,0x80));
+        else
+            IDirect3DDevice9_ColorFill(vd->sys->d3ddev, picsys->surface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0));
+
         picture_resource_t resource = {
             .p_sys = picsys,
             .pf_destroy = DestroyPicture,
@@ -1160,7 +1166,10 @@ static int Direct3D9CreatePool(vout_display_t *vd, video_format_t *fmt)
 #endif
 
     /* fill surface with black color */
-    IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0));
+    if (vlc_fourcc_IsYUV(d3dfmt->format))
+        IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, D3DCOLOR_XYUV(0,0x80,0x80));
+    else
+        IDirect3DDevice9_ColorFill(d3ddev, surface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0));
 
     /* Create the associated picture */
     picture_sys_t *picsys = malloc(sizeof(*picsys));
-- 
2.11.1



More information about the vlc-devel mailing list