[vlc-devel] [PATCH v2 13/29] opengl: expose GenTextures() and DelTextures()
Romain Vimont
rom1v at videolabs.io
Thu Feb 6 14:17:42 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 | 24 +++++++++++++----------
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/modules/video_output/opengl/interop.h b/modules/video_output/opengl/interop.h
index aea0d8e75e..ab054ee11a 100644
--- a/modules/video_output/opengl/interop.h
+++ b/modules/video_output/opengl/interop.h
@@ -164,6 +164,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_GenerateTextures(const struct vlc_gl_interop *interop,
+ const GLsizei *tex_width,
+ const GLsizei *tex_height, GLuint *textures);
+
+void
+vlc_gl_interop_DeleteTextures(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 8a461a3443..39b8edb4c1 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -311,10 +311,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_GenerateTextures(const struct vlc_gl_interop *interop,
+ const GLsizei *tex_width,
+ const GLsizei *tex_height, GLuint *textures)
{
interop->vt->GenTextures(interop->tex_count, textures);
@@ -347,8 +347,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_DeleteTextures(const struct vlc_gl_interop *interop,
+ GLuint *textures)
{
interop->vt->DeleteTextures(interop->tex_count, textures);
memset(textures, 0, interop->tex_count * sizeof(GLuint));
@@ -790,8 +791,9 @@ 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_GenerateTextures(vgl->prgm->tc->interop,
+ vgl->tex_width, vgl->tex_height,
+ vgl->texture);
if (ret != VLC_SUCCESS)
{
vout_display_opengl_Delete(vgl);
@@ -1013,7 +1015,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_GenerateTextures(interop, &glr->width,
+ &glr->height,
+ &glr->texture);
if (ret != VLC_SUCCESS)
break;
}
@@ -1035,7 +1039,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_DeleteTextures(interop, &last[i].texture);
}
free(last);
--
2.25.0
More information about the vlc-devel
mailing list