[vlc-devel] [PATCH 04/18] filter_chain: set the input video context before opening a filter
Steve Lhomme
robux4 at ycbcr.xyz
Mon Nov 18 08:37:37 CET 2019
On 2019-11-17 7:56, Rémi Denis-Courmont wrote:
> Hi,
>
> Handling the video context regardless of the filter type does not seem
> right. Only video filters should do that.
That would make the code more complex for no gain.
For example we don't have a special handling of the vlc_mouse_t handling
even though it's only used for video filters.
> Le 15 novembre 2019 15:51:06 GMT+01:00, Steve Lhomme <robux4 at ycbcr.xyz>
> a écrit :
>
> For now it's NULL for the first filter as we don't receive it yet.
> ------------------------------------------------------------------------
> src/misc/filter_chain.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
> index bbf1c19f388..6b309ed7ac3 100644
> --- a/src/misc/filter_chain.c
> +++ b/src/misc/filter_chain.c
> @@ -51,6 +51,7 @@ struct filter_chain_t
> chained_filter_t *first, *last; /**< List of filters */
>
> es_format_t fmt_in; /**< Chain input format (constant) */
> + vlc_video_context *vctx_in; /**< Chain input video context (set on Reset) */
> es_format_t fmt_out; /**< Chain output format (constant) */
> bool b_allow_fmt_out_change; /**< Each filter can change the output */
> const char *filter_cap; /**< Filter modules capability */
> @@ -77,6 +78,7 @@ static filter_chain_t *filter_chain_NewInner( vlc_object_t *obj,
> chain->first = NULL;
> chain->last = NULL;
> es_format_Init( &chain->fmt_in, cat, 0 );
> + chain->vctx_in = NULL;
> es_format_Init( &chain->fmt_out, cat, 0 );
> chain->b_allow_fmt_out_change = fmt_out_change;
> chain->filter_cap = cap;
> @@ -196,15 +198,23 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
> filter_t *filter = &chained->filter;
>
> const es_format_t *fmt_in;
> + vlc_video_context *vctx_in;
> if( chain->last != NULL )
> + {
> fmt_in = &chain->last->filter.fmt_out;
> + vctx_in = chain->last->filter.vctx_out;
> + }
> else
> + {
> fmt_in = &chain->fmt_in;
> + vctx_in = chain->vctx_in;
> + }
>
> if( fmt_out == NULL )
> fmt_out = &chain->fmt_out;
>
> es_format_Copy( &filter->fmt_in, fmt_in );
> + filter->vctx_in = vctx_in;
> es_format_Copy( &filter->fmt_out, fmt_out );
> filter->b_allow_fmt_out_change = chain->b_allow_fmt_out_change;
> filter->p_cfg = cfg;
>
>
> --
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser
> ma brièveté.
>
> _______________________________________________
> 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