[vlc-devel] [PATCH 4/6] opengl: remove always NULL pf_get_pool

Steve Lhomme robux4 at ycbcr.xyz
Mon Dec 23 14:04:23 CET 2019


---
 modules/video_output/opengl/converter.h   | 15 +------------
 modules/video_output/opengl/vout_helper.c | 27 -----------------------
 modules/video_output/opengl/vout_helper.h | 14 +++++++++---
 3 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/modules/video_output/opengl/converter.h b/modules/video_output/opengl/converter.h
index a3aba06621a..7e11bb05a6b 100644
--- a/modules/video_output/opengl/converter.h
+++ b/modules/video_output/opengl/converter.h
@@ -138,19 +138,6 @@ struct opengl_tex_converter_t
     int (*pf_allocate_textures)(const opengl_tex_converter_t *tc, GLuint *textures,
                                 const GLsizei *tex_width, const GLsizei *tex_height);
 
-    /**
-     * Callback to allocate a picture pool
-     *
-     * This function pointer *can* be NULL. If NULL, A generic pool with
-     * pictures allocated from the video_format_t will be used.
-     *
-     * \param tc OpenGL tex converter
-     * \param requested_count number of pictures to allocate
-     * \return the picture pool or NULL in case of error
-     */
-    picture_pool_t *(*pf_get_pool)(const opengl_tex_converter_t *tc,
-                                   unsigned requested_count);
-
     /**
      * Callback to update a picture
      *
@@ -205,7 +192,7 @@ struct opengl_tex_converter_t
  * generic fragment shader. It will compile a fragment shader generated from
  * the chroma and the tex target. This will initialize all elements of the
  * opengl_tex_converter_t struct except for priv, pf_allocate_texture,
- * pf_get_pool, pf_update
+ * pf_update
  *
  * \param tc OpenGL tex converter
  * \param tex_target GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 8e692eae5a0..3ab3f2c02f8 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -1024,33 +1024,6 @@ void vout_display_opengl_Viewport(vout_display_opengl_t *vgl, int x, int y,
     vgl->vt.Viewport(x, y, width, height);
 }
 
-bool vout_display_opengl_HasPool(const vout_display_opengl_t *vgl)
-{
-    opengl_tex_converter_t *tc = vgl->prgm->tc;
-    return tc->pf_get_pool != NULL;
-}
-
-picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned requested_count)
-{
-    GL_ASSERT_NOERROR();
-
-    if (vgl->pool)
-        return vgl->pool;
-
-    opengl_tex_converter_t *tc = vgl->prgm->tc;
-    requested_count = __MIN(VLCGL_PICTURE_MAX, requested_count);
-    /* Allocate with tex converter pool callback if it exists */
-    assert(tc->pf_get_pool != NULL);
-    vgl->pool = tc->pf_get_pool(tc, requested_count);
-    if (!vgl->pool)
-        goto error;
-    return vgl->pool;
-
-error:
-    DelTextures(tc, vgl->texture);
-    return NULL;
-}
-
 int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
                                 picture_t *picture, subpicture_t *subpicture)
 {
diff --git a/modules/video_output/opengl/vout_helper.h b/modules/video_output/opengl/vout_helper.h
index 2910f820014..5e324575a66 100644
--- a/modules/video_output/opengl/vout_helper.h
+++ b/modules/video_output/opengl/vout_helper.h
@@ -92,9 +92,17 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
                                                const vlc_viewpoint_t *viewpoint,
                                                vlc_video_context *context);
 void vout_display_opengl_Delete(vout_display_opengl_t *vgl);
-bool vout_display_opengl_HasPool(const vout_display_opengl_t *);
-
-picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned);
+static inline bool vout_display_opengl_HasPool(const vout_display_opengl_t *gl)
+{
+    (void) gl;
+    return false;
+}
+
+static inline picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned count)
+{
+    (void) vgl; (void) count;
+    return NULL;
+}
 
 int vout_display_opengl_SetViewpoint(vout_display_opengl_t *vgl, const vlc_viewpoint_t*);
 
-- 
2.17.1



More information about the vlc-devel mailing list