[vlc-devel] [PATCH 12/18] opengl: refactor generic_init()
Romain Vimont
rom1v at videolabs.io
Fri Dec 20 15:48:54 CET 2019
This function only initializes the importer, so rename it and pass the
importer 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 17a8f6d991..923c72a2c4 100644
--- a/modules/video_output/opengl/converter_sw.c
+++ b/modules/video_output/opengl/converter_sw.c
@@ -295,10 +295,8 @@ tc_common_update(const struct vlc_gl_importer *imp, GLuint *textures,
}
int
-opengl_tex_converter_generic_init(opengl_tex_converter_t *tc, bool allow_dr)
+opengl_importer_generic_init(struct vlc_gl_importer *imp, bool allow_dr)
{
- struct vlc_gl_importer *imp = &tc->importer;
-
video_color_space_t space;
const vlc_fourcc_t *list;
@@ -393,9 +391,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_importer_generic_deinit(struct vlc_gl_importer *imp)
{
- struct priv *priv = tc->importer.priv;
+ struct priv *priv = imp->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 2c64a6d72e..38781e3bf5 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_importer_generic_init(struct vlc_gl_importer *imp, bool);
void
-opengl_tex_converter_generic_deinit(opengl_tex_converter_t *tc);
+opengl_importer_generic_deinit(struct vlc_gl_importer *imp);
#endif /* include-guard */
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 1846fddb61..1f60dab058 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 (imp->priv != NULL)
- opengl_tex_converter_generic_deinit(tc);
+ opengl_importer_generic_deinit(imp);
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,
imp->fmt.transfer = TRANSFER_FUNC_UNDEF;
imp->fmt.space = COLOR_SPACE_UNDEF;
- ret = opengl_tex_converter_generic_init(tc, false);
+ ret = opengl_importer_generic_init(imp, 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_importer_generic_init(imp, true);
}
}
--
2.24.1
More information about the vlc-devel
mailing list