[vlc-commits] opengl: split xyz12_init()

Romain Vimont git at videolan.org
Mon Jan 13 11:44:14 CET 2020


vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Fri Nov 29 17:09:37 2019 +0100| [df21246888ddaf8d4b8f5637a737645f3c2137c1] | committer: Thomas Guillem

opengl: split xyz12_init()

Extract the interop-specific implementation to a separate function.

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

 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)
     {



More information about the vlc-commits mailing list