[vlc-devel] [PATCH 10/10] opengl: do not pass the picture_t to the renderer

Romain Vimont rom1v at videolabs.io
Wed May 20 16:08:21 CEST 2020


The renderer is expected to be independant of the input picture format.
Instead, update the sampler directly.
---
 modules/video_output/opengl/renderer.c    |  7 -------
 modules/video_output/opengl/renderer.h    | 12 ------------
 modules/video_output/opengl/vout_helper.c |  2 +-
 3 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/modules/video_output/opengl/renderer.c b/modules/video_output/opengl/renderer.c
index 9caad6d20bb1..a8986cdd05b9 100644
--- a/modules/video_output/opengl/renderer.c
+++ b/modules/video_output/opengl/renderer.c
@@ -764,13 +764,6 @@ static void DrawWithShaders(struct vlc_gl_renderer *renderer)
     vt->DrawElements(GL_TRIANGLES, renderer->nb_indices, GL_UNSIGNED_SHORT, 0);
 }
 
-int
-vlc_gl_renderer_Prepare(struct vlc_gl_renderer *renderer, picture_t *picture)
-{
-    struct vlc_gl_sampler *sampler = renderer->sampler;
-    return vlc_gl_sampler_Update(sampler, picture);
-}
-
 int
 vlc_gl_renderer_Draw(struct vlc_gl_renderer *renderer)
 {
diff --git a/modules/video_output/opengl/renderer.h b/modules/video_output/opengl/renderer.h
index d17e5299dd79..6e3f34b9de33 100644
--- a/modules/video_output/opengl/renderer.h
+++ b/modules/video_output/opengl/renderer.h
@@ -117,18 +117,6 @@ vlc_gl_renderer_New(vlc_gl_t *gl, const struct vlc_gl_api *api,
 void
 vlc_gl_renderer_Delete(struct vlc_gl_renderer *renderer);
 
-/**
- * Prepare the fragment shader
- *
- * Concretely, it allocates OpenGL textures if necessary and uploads the
- * picture.
- *
- * \param sr the renderer
- * \param subpicture the subpicture to render
- */
-int
-vlc_gl_renderer_Prepare(struct vlc_gl_renderer *renderer, picture_t *picture);
-
 /**
  * Draw the prepared picture
  *
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index e2bb9e0f458c..3cf479ae6668 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -261,7 +261,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
 {
     GL_ASSERT_NOERROR(&vgl->api.vt);
 
-    int ret = vlc_gl_renderer_Prepare(vgl->renderer, picture);
+    int ret = vlc_gl_sampler_Update(vgl->sampler, picture);
     if (ret != VLC_SUCCESS)
         return ret;
 
-- 
2.27.0.rc0



More information about the vlc-devel mailing list