[vlc-devel] [PATCH v2 3/3] video_output: remove the private pool

Rémi Denis-Courmont remi at remlab.net
Thu Aug 20 10:12:49 CEST 2020


Hi,

Ok. We should probably remove picture_pool_Reserve() later.

Le 17 août 2020 16:33:01 GMT+02:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>---
> src/video_output/video_output.c |  3 +--
> src/video_output/vout_private.h |  1 -
> src/video_output/vout_wrapper.c | 30 +++++-------------------------
> 3 files changed, 6 insertions(+), 28 deletions(-)
>
>diff --git a/src/video_output/video_output.c
>b/src/video_output/video_output.c
>index 09aaa10e98a..def6875cea0 100644
>--- a/src/video_output/video_output.c
>+++ b/src/video_output/video_output.c
>@@ -1703,7 +1703,6 @@ static int vout_Start(vout_thread_sys_t *vout,
>vlc_video_context *vctx, const vo
> 
>     sys->decoder_fifo = picture_fifo_New();
>     sys->private.display_pool = NULL;
>-    sys->private.private_pool = NULL;
> 
>     sys->filter.configuration = NULL;
>     video_format_Copy(&sys->filter.src_fmt, &sys->original);
>@@ -1784,7 +1783,7 @@ static int vout_Start(vout_thread_sys_t *vout,
>vlc_video_context *vctx, const vo
>         vout_SetDisplayAspect(sys->display, num, den);
>     vlc_mutex_unlock(&sys->display_lock);
> 
>-    assert(sys->private.display_pool != NULL &&
>sys->private.private_pool != NULL);
>+    assert(sys->private.display_pool != NULL);
> 
>     sys->displayed.current       = NULL;
>     sys->displayed.next          = NULL;
>diff --git a/src/video_output/vout_private.h
>b/src/video_output/vout_private.h
>index 261dcc30fe4..cb4c0bde6a8 100644
>--- a/src/video_output/vout_private.h
>+++ b/src/video_output/vout_private.h
>@@ -43,7 +43,6 @@ struct vout_thread_private_t
>         vlc_tick_t  date;
>     } interlacing;
> 
>-    picture_pool_t  *private_pool;
>     picture_pool_t  *display_pool;
> };
> 
>diff --git a/src/video_output/vout_wrapper.c
>b/src/video_output/vout_wrapper.c
>index 6445f99b7a2..6e751f4c238 100644
>--- a/src/video_output/vout_wrapper.c
>+++ b/src/video_output/vout_wrapper.c
>@@ -79,39 +79,20 @@ vout_display_t *vout_OpenWrapper(vout_thread_t
>*vout, vout_thread_private_t *sys
>     if (vd == NULL)
>         return NULL;
> 
>-    sys->display_pool = NULL;
>-
>-    const unsigned private_picture  = 4; /* XXX 3 for filter, 1 for
>SPU */
>     const unsigned kept_picture     = 1; /* last displayed picture */
>     const unsigned reserved_picture = DISPLAY_PICTURE_COUNT +
>-                                      private_picture +
>                                       kept_picture;
> 
>-    picture_pool_t *display_pool = vout_GetPool(vd, reserved_picture);
>-    if (display_pool == NULL)
>+    sys->display_pool = vout_GetPool(vd, reserved_picture);
>+    if (sys->display_pool == NULL)
>         goto error;
> 
> #ifndef NDEBUG
>-    if ( picture_pool_GetSize(display_pool) < reserved_picture )
>+    if ( picture_pool_GetSize(sys->display_pool) < reserved_picture )
>msg_Warn(vout, "Not enough display buffers in the pool, requested %u
>got %u",
>-                 reserved_picture,
>picture_pool_GetSize(display_pool));
>+                 reserved_picture,
>picture_pool_GetSize(sys->display_pool));
> #endif
> 
>-    if (!vout_IsDisplayFiltered(vd) &&
>-        picture_pool_GetSize(display_pool) >= reserved_picture) {
>-        sys->private_pool = picture_pool_Reserve(display_pool,
>private_picture);
>-    } else {
>-        sys->private_pool =
>-            picture_pool_NewFromFormat(&vd->source,
>-                                       __MAX(VOUT_MAX_PICTURES,
>-                                             reserved_picture -
>DISPLAY_PICTURE_COUNT));
>-    }
>-    if (sys->private_pool == NULL) {
>-        picture_pool_Release(display_pool);
>-        goto error;
>-    }
>-    sys->display_pool = display_pool;
>-
> #ifdef _WIN32
>   var_Create(vout, "video-wallpaper", VLC_VAR_BOOL|VLC_VAR_DOINHERIT);
>     var_AddCallback(vout, "video-wallpaper", Forward, vd);
>@@ -130,9 +111,8 @@ error:
>*****************************************************************************/
>void vout_CloseWrapper(vout_thread_t *vout, vout_thread_private_t *sys,
>vout_display_t *vd)
> {
>-    assert(sys->display_pool && sys->private_pool);
>+    assert(sys->display_pool);
> 
>-    picture_pool_Release(sys->private_pool);
>     sys->display_pool = NULL;
> 
> #ifdef _WIN32
>-- 
>2.26.2
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200820/f0312e38/attachment.html>


More information about the vlc-devel mailing list