[vlc-devel] [PATCH v2 12/21] opengl: refactor generic_init()

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


This function only initializes the interop, so rename it and pass the
interop instead of the tex_converter.
---
 modules/video_output/opengl/converter_sw.c | 8 +++-----
 modules/video_output/opengl/internal.h     | 4 ++--
 modules/video_output/opengl/vout_helper.c  | 6 +++---
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/modules/video_output/opengl/converter_sw.c b/modules/video_output/opengl/converter_sw.c
index c441c68ae2..6e4376c7b6 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -296,10 +296,8 @@ tc_common_update(const struct vlc_gl_interop *interop, GLuint *textures,
 }
 
 int
-opengl_tex_converter_generic_init(opengl_tex_converter_t *tc, bool allow_dr)
+opengl_interop_generic_init(struct vlc_gl_interop *interop, bool allow_dr)
 {
-    struct vlc_gl_interop *interop = &tc->interop;
-
     video_color_space_t space;
     const vlc_fourcc_t *list;
 
@@ -394,9 +392,9 @@ opengl_tex_converter_generic_init(opengl_tex_converter_t *tc, bool allow_dr)
 }
 
 void
-opengl_tex_converter_generic_deinit(opengl_tex_converter_t *tc)
+opengl_interop_generic_deinit(struct vlc_gl_interop *interop)
 {
-    struct priv *priv = tc->interop.priv;
+    struct priv *priv = interop->priv;
     for (size_t i = 0; i < PBO_DISPLAY_COUNT && priv->pbo.display_pics[i]; ++i)
         picture_Release(priv->pbo.display_pics[i]);
     free(priv->texture_temp_buf);
diff --git a/modules/video_output/opengl/internal.h b/modules/video_output/opengl/internal.h
index 7b13c4bba4..cef1ba0b4d 100644
--- a/modules/video_output/opengl/internal.h
+++ b/modules/video_output/opengl/internal.h
@@ -32,9 +32,9 @@ GLuint
 opengl_fragment_shader_init_impl(opengl_tex_converter_t *,
                                  GLenum, vlc_fourcc_t, video_color_space_t);
 int
-opengl_tex_converter_generic_init(opengl_tex_converter_t *, bool);
+opengl_interop_generic_init(struct vlc_gl_interop *interop, bool);
 
 void
-opengl_tex_converter_generic_deinit(opengl_tex_converter_t *tc);
+opengl_interop_generic_deinit(struct vlc_gl_interop *interop);
 
 #endif /* include-guard */
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 7cd259cdad..0cd32183d4 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -510,7 +510,7 @@ opengl_deinit_program(vout_display_opengl_t *vgl, struct prgm *prgm)
     if (tc->p_module != NULL)
         module_unneed(tc, tc->p_module);
     else if (interop->priv != NULL)
-        opengl_tex_converter_generic_deinit(tc);
+        opengl_interop_generic_deinit(interop);
     if (prgm->id != 0)
         vgl->vt.DeleteProgram(prgm->id);
 
@@ -588,7 +588,7 @@ opengl_init_program(vout_display_opengl_t *vgl, vlc_video_context *context,
         interop->fmt.transfer = TRANSFER_FUNC_UNDEF;
         interop->fmt.space = COLOR_SPACE_UNDEF;
 
-        ret = opengl_tex_converter_generic_init(tc, false);
+        ret = opengl_interop_generic_init(interop, false);
     }
     else
     {
@@ -613,7 +613,7 @@ opengl_init_program(vout_display_opengl_t *vgl, vlc_video_context *context,
         {
             /* Software chroma or gl hw converter failed: use a generic
              * converter */
-            ret = opengl_tex_converter_generic_init(tc, true);
+            ret = opengl_interop_generic_init(interop, true);
         }
     }
 
-- 
2.25.0.rc0



More information about the vlc-devel mailing list