[vlc-devel] [PATCH v2 06/21] opengl: use interop for rgb_base_init()

Romain Vimont rom1v at videolabs.io
Tue Jan 7 12:41:42 CET 2020


---
 modules/video_output/opengl/fragment_shaders.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index ac60ea9888..89499e6847 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -311,11 +311,10 @@ tc_yuv_base_init(opengl_tex_converter_t *tc, vlc_fourcc_t chroma,
 }
 
 static int
-tc_rgb_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
-                 vlc_fourcc_t chroma)
+interop_rgb_base_init(struct vlc_gl_interop *interop, GLenum tex_target,
+                      vlc_fourcc_t chroma)
 {
     (void) tex_target;
-    struct vlc_gl_interop *interop = &tc->interop;
 
     switch (chroma)
     {
@@ -326,7 +325,7 @@ tc_rgb_base_init(opengl_tex_converter_t *tc, GLenum tex_target,
             };
             break;
         case VLC_CODEC_BGRA: {
-            if (GetTexFormatSize(tc->vt, tex_target, GL_BGRA, GL_RGBA,
+            if (GetTexFormatSize(interop->vt, tex_target, GL_BGRA, GL_RGBA,
                                  GL_UNSIGNED_BYTE) != 32)
                 return VLC_EGENERIC;
             interop->texs[0] = (struct vlc_gl_tex_cfg) {
@@ -546,7 +545,7 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
             ret = tc_yuv_base_init(tc, chroma, desc, yuv_space, &yuv_swap_uv);
     }
     else
-        ret = tc_rgb_base_init(tc, tex_target, chroma);
+        ret = interop_rgb_base_init(&tc->interop, tex_target, chroma);
 
     if (ret != VLC_SUCCESS)
         return 0;
-- 
2.25.0.rc0



More information about the vlc-devel mailing list