[vlc-devel] [PATCH] [RFC] video output:win32: use the direct3d11 vout when d3d11va is selected

Steve Lhomme robux4 at videolabs.io
Tue Dec 13 17:20:32 CET 2016


otherwise we try to use the default D3D9 (which is he default because it's
better at I420) or the gl vout.

This allows using d3d11va without having to force the vout, so D3D9 is used
when it's more efficient and D3D11 with hardware decoding. Selecting the HW
decoder is still manually (they all have a 0 priority) and the number of
decoding threads needs to be adjusted, although this may change soon.
---
 modules/video_output/win32/direct3d11.c | 2 +-
 modules/video_output/win32/direct3d9.c  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 29702a1..080d8e8 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -83,7 +83,7 @@ vlc_module_begin ()
     add_integer("winrt-swapchain",     0x0, NULL, NULL, true); /* IDXGISwapChain1*     */
 #endif
 
-    set_capability("vout display", 240)
+    set_capability("vout display", 275)
     add_shortcut("direct3d11")
     set_callbacks(Open, Close)
 vlc_module_end ()
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index 25aef91..b37632a 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -205,6 +205,11 @@ static int Open(vlc_object_t *object)
     if (CommonInit(vd))
         goto error;
 
+#ifdef HAVE_D3D11_H
+    if (vd->source.i_chroma == VLC_CODEC_D3D11_OPAQUE)
+        goto error;
+#endif
+
     /* */
     video_format_t fmt;
     if (Direct3D9Open(vd, &fmt)) {
-- 
2.10.2



More information about the vlc-devel mailing list