[vlc-devel] [PATCH v2 07/21] opengl: split xyz12_init()

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


Extract the interop-specific implementation to a separate function.
---
 modules/video_output/opengl/fragment_shaders.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/opengl/fragment_shaders.c b/modules/video_output/opengl/fragment_shaders.c
index 89499e6847..e54fdf389d 100644
--- a/modules/video_output/opengl/fragment_shaders.c
+++ b/modules/video_output/opengl/fragment_shaders.c
@@ -457,17 +457,19 @@ tc_xyz12_prepare_shader(const opengl_tex_converter_t *tc,
     tc->vt->Uniform1i(tc->uloc.Texture[0], 0);
 }
 
-static GLuint
-xyz12_shader_init(opengl_tex_converter_t *tc)
+static void
+interop_xyz12_init(struct vlc_gl_interop *interop)
 {
-    struct vlc_gl_interop *interop = &tc->interop;
-
     interop->tex_count = 1;
     interop->tex_target = GL_TEXTURE_2D;
     interop->texs[0] = (struct vlc_gl_tex_cfg) {
         { 1, 1 }, { 1, 1 }, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT
     };
+}
 
+static GLuint
+xyz12_shader_init(opengl_tex_converter_t *tc)
+{
     tc->pf_fetch_locations = tc_xyz12_fetch_locations;
     tc->pf_prepare_shader = tc_xyz12_prepare_shader;
 
@@ -535,7 +537,10 @@ opengl_fragment_shader_init_impl(opengl_tex_converter_t *tc, GLenum tex_target,
         return 0;
 
     if (chroma == VLC_CODEC_XYZ12)
+    {
+        interop_xyz12_init(&tc->interop);
         return xyz12_shader_init(tc);
+    }
 
     if (is_yuv)
     {
-- 
2.25.0.rc0



More information about the vlc-devel mailing list