[vlc-commits] opengl: expose GenTextures() and DelTextures()
Romain Vimont
git at videolan.org
Thu Feb 13 23:12:56 CET 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Jan 21 13:47:57 2020 +0100| [03db0b97ea78e3092b07344ff10fb688eb7071b2] | committer: Jean-Baptiste Kempf
opengl: expose GenTextures() and DelTextures()
These util functions will be called from other files.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03db0b97ea78e3092b07344ff10fb688eb7071b2
---
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);
More information about the vlc-commits
mailing list