dxva2: select the render format based on the opaque chroma
authorSteve Lhomme <robux4@ycbcr.xyz>
Mon, 22 Jul 2019 11:52:04 +0000 (13:52 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Mon, 4 Nov 2019 10:42:53 +0000 (11:42 +0100)
This is similar to what is done in the display module.

modules/codec/avcodec/dxva2.c

index 15ec799..3caa648 100644 (file)
@@ -291,6 +291,18 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
 
     va->sys = sys;
 
+    switch (fmt_out->i_chroma)
+    {
+        case VLC_CODEC_D3D9_OPAQUE_10B:
+            sys->render = MAKEFOURCC('P','0','1','0');
+            break;
+        case VLC_CODEC_D3D9_OPAQUE:
+            sys->render =  MAKEFOURCC('N','V','1','2');
+            break;
+        default:
+            vlc_assert_unreachable();
+    }
+
     /* Load dll*/
     sys->dxva2_dll = LoadLibrary(TEXT("DXVA2.DLL"));
     if (!sys->dxva2_dll) {