[vlc-devel] [PATCH 3/4] dxva2: select the render format based on the opaque chroma

Steve Lhomme robux4 at ycbcr.xyz
Fri Oct 25 12:20:43 CEST 2019


This is similar to what is done in the display module.
---
 modules/codec/avcodec/dxva2.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 47f5dc9243c..c1951b0ceee 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -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) {
-- 
2.17.1



More information about the vlc-devel mailing list