[vlc-devel] [PATCH 2/3] display: remove always NULL pool callback

Steve Lhomme robux4 at ycbcr.xyz
Thu Jan 16 10:03:25 CET 2020


---
 include/vlc_vout_display.h | 11 -----------
 src/video_output/display.c | 24 +-----------------------
 2 files changed, 1 insertion(+), 34 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 664b7706a9b..411bdd0332d 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -308,17 +308,6 @@ struct vout_display_t {
      */
     vout_display_info_t info;
 
-    /* Return a pointer over the current picture_pool_t* (optional).
-     *
-     * For performance reasons, it is best to provide at least count
-     * pictures but it is not mandatory.
-     * You can return NULL when you cannot/do not want to allocate
-     * pictures.
-     * The vout display module keeps the ownership of the pool and can
-     * destroy it only when closing or on invalid pictures control.
-     */
-    picture_pool_t *(*pool)(vout_display_t *, unsigned count);
-
     /**
      * Prepares a picture and an optional subpicture for display (optional).
      *
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 1f581672422..76d49ee240d 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -413,9 +413,6 @@ picture_pool_t *vout_GetPool(vout_display_t *vd, unsigned count)
 {
     vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
 
-    if (vd->pool != NULL)
-        return vd->pool(vd, count);
-
     if (osys->pool == NULL)
         osys->pool = picture_pool_NewFromFormat(&vd->fmt, count);
     return osys->pool;
@@ -437,25 +434,7 @@ picture_t *vout_ConvertForDisplay(vout_display_t *vd, picture_t *picture)
         return NULL;
     }
 
-    picture = filter_chain_VideoFilter(osys->converters, picture);
-
-    if (picture != NULL && vd->pool != NULL && picture->i_planes > 0) {
-        picture_pool_t *pool = vd->pool(vd, 3);
-
-        if (!picture_pool_OwnsPic(pool, picture)) {
-            /* The picture is not be allocated from the expected pool. Copy. */
-            picture_t *direct = picture_pool_Get(pool);
-
-            if (direct != NULL) {
-                video_format_CopyCropAr(&direct->format, &picture->format);
-                picture_Copy(direct, picture);
-            }
-            picture_Release(picture);
-            picture = direct;
-        }
-    }
-
-    return picture;
+    return filter_chain_VideoFilter(osys->converters, picture);
 }
 
 picture_t *vout_display_Prepare(vout_display_t *vd, picture_t *picture,
@@ -778,7 +757,6 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
     video_format_Copy(&vd->source, source);
     vd->info = (vout_display_info_t){ };
     vd->cfg = &osys->cfg;
-    vd->pool = NULL;
     vd->prepare = NULL;
     vd->display = NULL;
     vd->control = NULL;
-- 
2.17.1



More information about the vlc-devel mailing list