[vlc-devel] [PATCH] video_output: handle draining of interactive filters before using prerendered pics

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 15 13:41:21 CEST 2020


This patch makes my "epileptic" filter work and not leak.

The "draining" is in line with my transcoding patch:
[v2 18/20] transcode: video: drain all filter chains sequentially until 
they're dry

We still don't consider the last "converter" chain to produce more than 
1 picture in the display. It should never be the case (maybe in the 
transcode it should be separated as well).

I'd still like to be able to use the same code for transcode and video 
output for all this. The display having the extra possibility of 
dropping late pictures.

On 2020-10-15 13:37, Steve Lhomme wrote:
> Interactive/User filters are allowed to output more than one frame at a time.
> (it could also be deinterlacers or fps filters added manually)
> 
> This introduces some timing differences in the processing time we use to adjust
> the estimated display time. The drain may be faster or slower than the regular
> filtering call.
> 
> Filter (chains) that only output one picture at the time won't be affected.
> 
> Before this patch, extra pictures from interactive filters were simply dropped
> and never displayed.
> ---
>   src/video_output/video_output.c | 14 +++++++++++---
>   1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
> index 0233e214d9e..f3efd2f82c2 100644
> --- a/src/video_output/video_output.c
> +++ b/src/video_output/video_output.c
> @@ -1223,14 +1223,22 @@ static int ThreadDisplayRenderPicture(vout_thread_sys_t *vout, bool is_forced)
>   {
>       vout_thread_sys_t *sys = vout;
>   
> -    picture_t *torender = picture_Hold(sys->displayed.current);
> -
>       vout_chrono_Start(&sys->render);
>   
>       vlc_mutex_lock(&sys->filter.lock);
> -    picture_t *filtered = filter_chain_VideoFilter(sys->filter.chain_interactive, torender);
> +    picture_t *filtered = filter_chain_VideoFilter(sys->filter.chain_interactive, NULL);
>       vlc_mutex_unlock(&sys->filter.lock);
>   
> +    if (filtered == NULL)
> +    {
> +        // hold it as the filter chain will release it or return it and we release it
> +        picture_t *torender = picture_Hold(sys->displayed.current);
> +
> +        vlc_mutex_lock(&sys->filter.lock);
> +        filtered = filter_chain_VideoFilter(sys->filter.chain_interactive, torender);
> +        vlc_mutex_unlock(&sys->filter.lock);
> +    }
> +
>       if (!filtered)
>           return VLC_EGENERIC;
>   
> -- 
> 2.26.2
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list