[vlc-devel] [PATCH 5/6] dxva2_deinterlace: check that the deinterlacing is actually going to work

Steve Lhomme robux4 at videolabs.io
Tue Aug 1 10:25:46 CEST 2017


It doesn't work on NVIDIA (works in D3D11) and thus no deinterlacing is done.
It's better to fallback to software mode in this case.
---
 modules/video_output/win32/dxva2_deinterlace.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/modules/video_output/win32/dxva2_deinterlace.c b/modules/video_output/win32/dxva2_deinterlace.c
index 695e51e1a3..0f2be2c536 100644
--- a/modules/video_output/win32/dxva2_deinterlace.c
+++ b/modules/video_output/win32/dxva2_deinterlace.c
@@ -382,6 +382,30 @@ static int Open(vlc_object_t *obj)
        goto error;
     }
 
+    /* check if the deinterlacer works, it doesn't with NVIDIA */
+    RECT area;
+    DXVA2_VideoSample samples[1];
+    DXVA2_VideoProcessBltParams params;
+
+    area.top = area.left = 0;
+    area.bottom = dstDesc.Height;
+    area.right  = dstDesc.Width;
+
+    FillSample( samples, &sys->context, dst, &out_fmt, &area, 0 );
+
+    FillBlitParams( &params, &area, samples, 0 );
+
+    hr = IDirectXVideoProcessor_VideoProcessBlt( sys->processor,
+                                                 sys->hw_surface,
+                                                 &params,
+                                                 samples,
+                                                 1, NULL );
+    if (FAILED(hr))
+    {
+        msg_Dbg(filter, "impossible to use deinterlacer: 0x%0lx", hr);
+        goto error;
+    }
+
     CoTaskMemFree(processorGUIDs);
     IDirectXVideoProcessorService_Release(processor);
     picture_Release(dst);
-- 
2.12.1



More information about the vlc-devel mailing list