[vlc-devel] [PATCH 10/24] opengl: expose GenTextures() and DelTextures()

Romain Vimont rom1v at videolabs.io
Mon Jan 27 21:20:00 CET 2020


These util functions will be called from other files.
---
 modules/video_output/opengl/interop.h     |  9 +++++++++
 modules/video_output/opengl/vout_helper.c | 23 +++++++++++++----------
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/modules/video_output/opengl/interop.h b/modules/video_output/opengl/interop.h
index dbdacc766b..db8f77ec48 100644
--- a/modules/video_output/opengl/interop.h
+++ b/modules/video_output/opengl/interop.h
@@ -160,6 +160,15 @@ vlc_gl_interop_New(struct vlc_gl_t *gl, const opengl_vtable_t *vt,
 void
 vlc_gl_interop_Delete(struct vlc_gl_interop *interop);
 
+int
+vlc_gl_interop_GenTextures(const struct vlc_gl_interop *interop,
+                           const GLsizei *tex_width,
+                           const GLsizei *tex_height, GLuint *textures);
+
+void
+vlc_gl_interop_DelTextures(const struct vlc_gl_interop *interop,
+                           GLuint *textures);
+
 static inline int
 opengl_interop_init(struct vlc_gl_interop *interop, GLenum tex_target,
                     vlc_fourcc_t chroma, video_color_space_t yuv_space)
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 892da547f0..34194cf815 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -337,10 +337,10 @@ static GLuint BuildVertexShader(const opengl_tex_converter_t *tc,
     return shader;
 }
 
-static int
-GenTextures(const struct vlc_gl_interop *interop,
-            const GLsizei *tex_width, const GLsizei *tex_height,
-            GLuint *textures)
+int
+vlc_gl_interop_GenTextures(const struct vlc_gl_interop *interop,
+                           const GLsizei *tex_width,
+                           const GLsizei *tex_height, GLuint *textures)
 {
     interop->vt->GenTextures(interop->tex_count, textures);
 
@@ -373,8 +373,9 @@ GenTextures(const struct vlc_gl_interop *interop,
     return VLC_SUCCESS;
 }
 
-static void
-DelTextures(const struct vlc_gl_interop *interop, GLuint *textures)
+void
+vlc_gl_interop_DelTextures(const struct vlc_gl_interop *interop,
+                           GLuint *textures)
 {
     interop->vt->DeleteTextures(interop->tex_count, textures);
     memset(textures, 0, interop->tex_count * sizeof(GLuint));
@@ -817,8 +818,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
 
     if (!interop->handle_texs_gen)
     {
-        ret = GenTextures(vgl->prgm->tc->interop, vgl->tex_width, vgl->tex_height,
-                          vgl->texture);
+        ret = vlc_gl_interop_GenTextures(vgl->prgm->tc->interop, vgl->tex_width,
+                                         vgl->tex_height, vgl->texture);
         if (ret != VLC_SUCCESS)
         {
             vout_display_opengl_Delete(vgl);
@@ -1038,7 +1039,9 @@ vout_display_opengl_PrepareSubPicture(vout_display_opengl_t *vgl,
             if (!glr->texture)
             {
                 /* Could not recycle a previous texture, generate a new one. */
-                int ret = GenTextures(interop, &glr->width, &glr->height, &glr->texture);
+                int ret = vlc_gl_interop_GenTextures(interop, &glr->width,
+                                                     &glr->height,
+                                                     &glr->texture);
                 if (ret != VLC_SUCCESS)
                     break;
             }
@@ -1060,7 +1063,7 @@ vout_display_opengl_PrepareSubPicture(vout_display_opengl_t *vgl,
 
     for (int i = 0; i < last_count; i++) {
         if (last[i].texture)
-            DelTextures(interop, &last[i].texture);
+            vlc_gl_interop_DelTextures(interop, &last[i].texture);
     }
     free(last);
 
-- 
2.25.0



More information about the vlc-devel mailing list