[vlc-devel] [PATCH 4/7] direct3d11: favor NV12 output for VLC_CODEC_D3D9_OPAQUE input

Steve Lhomme robUx4 at videolabs.io
Mon May 25 13:49:48 CEST 2015


to avoid an extra plane conversion between the decoder and the vout

---
only apply when VLC_CODEC_D3D9_OPAQUE is added
---
 modules/video_output/msw/direct3d11.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/msw/direct3d11.c b/modules/video_output/msw/direct3d11.c
index 290c636..d105a98 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -699,10 +699,16 @@ static int Direct3D11Open(vout_display_t *vd, video_format_t *fmt)
 # endif
 #endif
 
+    vlc_fourcc_t i_src_chroma;
+    if (fmt->i_chroma == VLC_CODEC_D3D9_OPAQUE)
+        i_src_chroma = VLC_CODEC_NV12; // favor NV12
+    else
+        i_src_chroma = fmt->i_chroma;
+
     // look for the request pixel format first
     for (unsigned i = 0; d3d_formats[i].name != 0; i++)
     {
-        if( fmt->i_chroma == d3d_formats[i].fourcc)
+        if( i_src_chroma == d3d_formats[i].fourcc)
         {
             UINT i_formatSupport;
             if( SUCCEEDED( ID3D11Device_CheckFormatSupport(sys->d3ddevice,
-- 
2.4.0




More information about the vlc-devel mailing list