[vlc-commits] direct3d11: select a RGB/YUV output format first based on the source

Steve Lhomme git at videolan.org
Tue Dec 17 08:26:59 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Dec 16 11:14:04 2019 +0100| [f53ee882f2e2645f4c538ace350a2351aa442c24] | committer: Steve Lhomme

direct3d11: select a RGB/YUV output format first based on the source

And the other way around if one is not found.

This is the source format we use to render, not the swapchain format which is more
likely to use RGB.

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

 modules/video_output/win32/direct3d11.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index dc0e39779c..828a41890e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -916,12 +916,12 @@ static int SetupOutputFormat(vout_display_t *vd, video_format_t *fmt)
         sys->picQuad.textureFormat = GetDisplayFormatByDepth(vd, bits_per_channel,
                                                              widthDenominator, heightDenominator,
                                                              decoder_format!=NULL,
-                                                             is_rgb ? D3D11_RGB_FORMAT : (D3D11_YUV_FORMAT|D3D11_RGB_FORMAT));
-        if (!sys->picQuad.textureFormat && is_rgb)
+                                                             is_rgb ? D3D11_RGB_FORMAT : D3D11_YUV_FORMAT);
+        if (!sys->picQuad.textureFormat)
             sys->picQuad.textureFormat = GetDisplayFormatByDepth(vd, bits_per_channel,
                                                                  widthDenominator, heightDenominator,
                                                                  decoder_format!=NULL,
-                                                                 D3D11_YUV_FORMAT);
+                                                                 is_rgb ? D3D11_YUV_FORMAT : D3D11_RGB_FORMAT);
     }
 
     // look for any pixel format that we can handle



More information about the vlc-commits mailing list