[FFmpeg-devel] [PATCH 4/5] lavfi: add FF_*LINK_IDX convenience macros.

Stefano Sabatini stefasab at gmail.com
Fri Jul 20 12:47:10 CEST 2012


On date Thursday 2012-07-19 14:47:45 +0200, Nicolas George encoded:
> 
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
> ---
>  libavfilter/internal.h |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavfilter/internal.h b/libavfilter/internal.h
> index b80a6fe..e388581 100644
> --- a/libavfilter/internal.h
> +++ b/libavfilter/internal.h
> @@ -350,4 +350,12 @@ int ff_request_frame(AVFilterLink *link);
>  AVFilterBufferRef *ff_copy_buffer_ref(AVFilterLink *outlink,
>                                        AVFilterBufferRef *ref);
>  
> +/**
> + * Find the index of a link.
> + *
> + * I.e. find i such that link == ctx->(in|out)puts[i]
> + */
> +#define FF_INLINK_IDX (link) ((int)((link)->dstpad - (link)->dst->input_pads))
> +#define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads))
> +

Should be correct and fine if useful.
-- 
FFmpeg = Fantastic & Fantastic Mortal Pacific Exuberant Gadget


More information about the ffmpeg-devel mailing list