[vlc-commits] gl: fix VLC_CODEC_CVPX_UYVY fragment shader

Thomas Guillem git at videolan.org
Thu Aug 24 15:16:08 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Aug 24 15:14:10 2017 +0200| [cd7de4295f411bf0bb63145dfd7adf4923606fd7] | committer: Thomas Guillem

gl: fix VLC_CODEC_CVPX_UYVY fragment shader

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

 modules/video_output/opengl/converter_cvpx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/opengl/converter_cvpx.c b/modules/video_output/opengl/converter_cvpx.c
index e388551b2e..1c8d44e21b 100644
--- a/modules/video_output/opengl/converter_cvpx.c
+++ b/modules/video_output/opengl/converter_cvpx.c
@@ -194,12 +194,19 @@ opengl_tex_converter_cvpx_init(opengl_tex_converter_t *tc)
     switch (tc->fmt.i_chroma)
     {
         case VLC_CODEC_CVPX_UYVY:
+            /* Generate a VLC_CODEC_VYUY shader in order to use the "gbr"
+             * swizzling. Indeed, the Y, Cb and Cr color channels within the
+             * GL_RGB_422_APPLE format are mapped into the existing green, blue
+             * and red color channels, respectively. cf. APPLE_rgb_422 khronos
+             * extenstion. */
+
             fragment_shader =
-                opengl_fragment_shader_init(tc, tex_target, VLC_CODEC_UYVY,
+                opengl_fragment_shader_init(tc, tex_target, VLC_CODEC_VYUY,
                                             COLOR_SPACE_UNDEF);
             tc->texs[0].internal = GL_RGB;
             tc->texs[0].format = GL_RGB_422_APPLE;
             tc->texs[0].type = GL_UNSIGNED_SHORT_8_8_APPLE;
+            tc->texs[0].w = tc->texs[0].h = (vlc_rational_t) { 1, 1 };
             break;
         case VLC_CODEC_CVPX_NV12:
         {



More information about the vlc-commits mailing list