[vlc-commits] [Git][videolan/vlc][master] 3 commits: interop_sw: remove used unused call

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Sep 6 08:51:55 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
7670cea7 by Steve Lhomme at 2023-09-06T07:22:55+00:00
interop_sw: remove used unused call

The variables are used.

- - - - -
38dd68f9 by Steve Lhomme at 2023-09-06T07:22:55+00:00
opengl/sw: favor RGBA when the RGB source is not accepted

The RGB fallback formats mostly consist of formats with a mask. This should
be avoided when we can just use RGBA.

- - - - -
e28a7a1b by Steve Lhomme at 2023-09-06T07:22:55+00:00
opengl/sw: don't try VLC_CODEC_XYZ12 twice

No need to create a list just to test the same chroma again.

- - - - -


1 changed file:

- modules/video_output/opengl/interop_sw.c


Changes:

=====================================
modules/video_output/opengl/interop_sw.c
=====================================
@@ -436,8 +436,6 @@ static int
 interop_yuv_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
                       vlc_fourcc_t chroma, const vlc_chroma_description_t *desc)
 {
-    (void) chroma;
-
     struct interop_formats
     {
         GLint intfmt;
@@ -606,8 +604,6 @@ static int
 interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
                       vlc_fourcc_t chroma)
 {
-    (void) tex_target;
-
     switch (chroma)
     {
         case VLC_CODEC_RGB24:
@@ -719,8 +715,9 @@ opengl_interop_generic_init(struct vlc_gl_interop *interop, bool allow_dr)
 
     video_color_space_t space;
     const vlc_fourcc_t *list;
+    const bool is_yup = vlc_fourcc_IsYUV(interop->fmt_in.i_chroma);
 
-    if (vlc_fourcc_IsYUV(interop->fmt_in.i_chroma))
+    if (is_yup)
     {
         GLint max_texture_units = 0;
         priv->gl.GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
@@ -732,8 +729,7 @@ opengl_interop_generic_init(struct vlc_gl_interop *interop, bool allow_dr)
     }
     else if (interop->fmt_in.i_chroma == VLC_CODEC_XYZ12)
     {
-        static const vlc_fourcc_t xyz12_list[] = { VLC_CODEC_XYZ12, 0 };
-        list = xyz12_list;
+        list = NULL;
         space = COLOR_SPACE_UNDEF;
     }
     else
@@ -751,6 +747,17 @@ opengl_interop_generic_init(struct vlc_gl_interop *interop, bool allow_dr)
     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);
+        if (ret == VLC_SUCCESS)
+            goto interop_init;
+    }
+
+    if (list == NULL)
+        goto error;
+
     /* Check whether any fallback for the chroma is translatable to OpenGL. */
     while (*list)
     {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/158b9c7f733ce13ed5dbe5186020bfe871c3598f...e28a7a1bf069bddaa6201c446ece10c01bb52b74

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/158b9c7f733ce13ed5dbe5186020bfe871c3598f...e28a7a1bf069bddaa6201c446ece10c01bb52b74
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