[vlc-commits] [Git][videolan/vlc][master] 2 commits: opengl/sw: remove unused fallback_masks

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Oct 3 08:01:57 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a8df11ec by Steve Lhomme at 2023-10-03T07:36:12+00:00
opengl/sw: remove unused fallback_masks

The RGB chromas that need mask fixing left are RGB16 and RGB15.

The only chroma that vlc_fourcc_GetRGBFallback() may provide is RGB16.
But fixing RGB16 ends up being equivalent to VLC_CODEC_RGB565LE, which
is listed before RGB16 in all the RGB fallback lists. So if RGB565LE is
not supported RGB16 + default mask won't be either. And in fact neither
are referenced by any OpenGL code, so it will never happen.

It would have been used only if interop_rgb_base_init() supported them
as that's what is called to try to support the tested chromas. But only
chromas without a mask are supported since eaf149b7f8082aba094bfa17fcc50c51520deca5.

Partial revert of remaining bits from 3b4d89ac00f15681cb49368f051f666c6cdd0296.

- - - - -
5233ea3d by Steve Lhomme at 2023-10-03T07:36:12+00:00
opengl/sw: remove always identical parameter

It's always GL_TEXTURE_2D.

- - - - -


1 changed file:

- modules/video_output/opengl/interop_sw.c


Changes:

=====================================
modules/video_output/opengl/interop_sw.c
=====================================
@@ -433,7 +433,7 @@ static bool fixGLFormat(struct vlc_gl_interop *interop, GLint* intfmt, GLint* fm
 }
 
 static int
-interop_yuv_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
+interop_yuv_base_init(struct vlc_gl_interop *interop,
                       vlc_fourcc_t chroma, const vlc_chroma_description_t *desc)
 {
     struct interop_formats
@@ -544,7 +544,7 @@ interop_yuv_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
 
     if (desc->pixel_size == 2)
     {
-        if (vlc_gl_interop_GetTexFormatSize(interop, tex_target, format->fmt,
+        if (vlc_gl_interop_GetTexFormatSize(interop, GL_TEXTURE_2D, format->fmt,
                                             format->intfmt, GL_UNSIGNED_SHORT) != 16)
             return VLC_EGENERIC;
     }
@@ -566,7 +566,7 @@ interop_yuv_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
         interop->tex_count = 2;
 
         if (desc->pixel_size == 2 &&
-            vlc_gl_interop_GetTexFormatSize(interop, tex_target, format->plane2_fmt,
+            vlc_gl_interop_GetTexFormatSize(interop, GL_TEXTURE_2D, format->plane2_fmt,
                 format->plane2_intfmt, format->plane2_type) != 16)
         {
             return VLC_EGENERIC;
@@ -601,8 +601,7 @@ interop_yuv_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
 }
 
 static int
-interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
-                      vlc_fourcc_t chroma, bool fallback_masks)
+interop_rgb_base_init(struct vlc_gl_interop *interop, vlc_fourcc_t chroma)
 {
     switch (chroma)
     {
@@ -625,7 +624,7 @@ interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
             };
             break;
         case VLC_CODEC_BGRA: {
-            if (vlc_gl_interop_GetTexFormatSize(interop, tex_target, GL_BGRA, GL_RGBA,
+            if (vlc_gl_interop_GetTexFormatSize(interop, GL_TEXTURE_2D, GL_BGRA, GL_RGBA,
                                                 GL_UNSIGNED_BYTE) != 32)
                 return VLC_EGENERIC;
             interop->texs[0] = (struct vlc_gl_tex_cfg) {
@@ -651,9 +650,8 @@ interop_xyz12_init(struct vlc_gl_interop *interop)
 }
 
 static int
-opengl_interop_init(struct vlc_gl_interop *interop, GLenum tex_target,
-                    vlc_fourcc_t chroma, video_color_space_t yuv_space,
-                    bool fallback_masks)
+opengl_interop_init(struct vlc_gl_interop *interop,
+                    vlc_fourcc_t chroma, video_color_space_t yuv_space)
 {
     bool is_yuv = vlc_fourcc_IsYUV(chroma);
     const vlc_chroma_description_t *desc =
@@ -663,10 +661,8 @@ opengl_interop_init(struct vlc_gl_interop *interop, GLenum tex_target,
 
     assert(!interop->fmt_out.p_palette);
     interop->fmt_out.i_chroma = chroma;
-    if(fallback_masks && !is_yuv)
-        video_format_FixRgb(&interop->fmt_out);
     interop->fmt_out.space = yuv_space;
-    interop->tex_target = tex_target;
+    interop->tex_target = GL_TEXTURE_2D;
 
     if (chroma == VLC_CODEC_XYZ12)
     {
@@ -675,9 +671,9 @@ opengl_interop_init(struct vlc_gl_interop *interop, GLenum tex_target,
     }
 
     if (is_yuv)
-        return interop_yuv_base_init(interop, tex_target, chroma, desc);
+        return interop_yuv_base_init(interop, chroma, desc);
 
-    return interop_rgb_base_init(interop, tex_target, chroma, fallback_masks);
+    return interop_rgb_base_init(interop, chroma);
 }
 
 static void
@@ -752,14 +748,14 @@ opengl_interop_generic_init(struct vlc_gl_interop *interop, bool allow_dr)
 
     /* Check whether the given chroma is translatable to OpenGL. */
     vlc_fourcc_t i_chroma = interop->fmt_in.i_chroma;
-    int ret = opengl_interop_init(interop, GL_TEXTURE_2D, i_chroma, space, false);
+    int ret = opengl_interop_init(interop, i_chroma, space);
     if (ret == VLC_SUCCESS)
         goto interop_init;
 
     if (!is_yup)
     {
         i_chroma = VLC_CODEC_RGBA;
-        ret = opengl_interop_init(interop, GL_TEXTURE_2D, i_chroma, space, false);
+        ret = opengl_interop_init(interop, i_chroma, space);
         if (ret == VLC_SUCCESS)
             goto interop_init;
     }
@@ -770,7 +766,7 @@ opengl_interop_generic_init(struct vlc_gl_interop *interop, bool allow_dr)
     /* Check whether any fallback for the chroma is translatable to OpenGL. */
     while (*list)
     {
-        ret = opengl_interop_init(interop, GL_TEXTURE_2D, *list, space, true);
+        ret = opengl_interop_init(interop, *list, space);
         if (ret == VLC_SUCCESS)
         {
             i_chroma = *list;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c09a9dfd51196aacb8b649ded69b8de4e3e7faa2...5233ea3df88071969e2fc17748ec087e353cc03e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c09a9dfd51196aacb8b649ded69b8de4e3e7faa2...5233ea3df88071969e2fc17748ec087e353cc03e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list