[vlc-commits] direct3d11: use a fallback chroma when default doesn't work and vout is forced

Steve Lhomme git at videolan.org
Tue Nov 28 12:26:08 CET 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Nov 28 11:19:24 2017 +0100| [8049ee949103b1ee25bd67299feb5c0eabe3c845] | committer: Jean-Baptiste Kempf

direct3d11: use a fallback chroma when default doesn't work and vout is forced

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8049ee949103b1ee25bd67299feb5c0eabe3c845
---

 modules/video_output/win32/direct3d11.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index da9e5b778c..aee028fbc7 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1480,7 +1480,24 @@ static int Direct3D11Open(vout_display_t *vd)
     video_format_Copy(&fmt, &vd->source);
     int err = SetupOutputFormat(vd, &fmt);
     if (err != VLC_SUCCESS)
-        return err;
+    {
+        if (!is_d3d11_opaque(vd->source.i_chroma) && vd->obj.force )
+        {
+            const vlc_fourcc_t *list = vlc_fourcc_IsYUV(vd->source.i_chroma) ?
+                        vlc_fourcc_GetYUVFallback(vd->source.i_chroma) :
+                        vlc_fourcc_GetRGBFallback(vd->source.i_chroma);
+            for (unsigned i = 0; list[i] != 0; i++) {
+                fmt.i_chroma = list[i];
+                if (fmt.i_chroma == vd->source.i_chroma)
+                    continue;
+                err = SetupOutputFormat(vd, &fmt);
+                if (err == VLC_SUCCESS)
+                    break;
+            }
+        }
+        if (err != VLC_SUCCESS)
+            return err;
+    }
 
     if (Direct3D11CreateGenericResources(vd)) {
         msg_Err(vd, "Failed to allocate resources");



More information about the vlc-commits mailing list