[FFmpeg-devel] [PATCH 2/2] lavfi/avfilter: add avfilter_graph_get_filters_by_name() function

Lukasz Marek lukasz.m.luki2 at gmail.com
Fri Apr 25 12:43:25 CEST 2014


On 25 April 2014 09:58, Nicolas George <george at nsup.org> wrote:

> Le sextidi 6 floréal, an CCXXII, Lukasz Marek a écrit :
> > TODO: update doc/APIChanges and bump minor.
> >
> > Allows to search for filters when instance name is not known.
> >
> > Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>
> > ---
> >  libavfilter/avfilter.h      | 12 ++++++++++++
> >  libavfilter/avfiltergraph.c | 20 ++++++++++++++++++++
> >  2 files changed, 32 insertions(+)
> >
> > diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> > index 0cc5274..c9428b1 100644
> > --- a/libavfilter/avfilter.h
> > +++ b/libavfilter/avfilter.h
> > @@ -1276,6 +1276,18 @@ AVFilterContext
> *avfilter_graph_alloc_filter(AVFilterGraph *graph,
> >   */
> >  AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, const
> char *name);
> >
> > +/**
> > + * Get filter instances identified by filter name from graph.
> > + *
> > + * Returned array must be freed with av_free().
> > + *
> > + * @param graph filter graph to search through.
> > + * @param name filter name (not unique in the graph).
> > + * @param[out] count number of found filters. May be NULL.
> > + * @return array of found filters or NULL on failure.
>
> How is the caller suppose to distinguish between failure because of
> external
> conditions (ENOMEM) and simply 0 filters being found?
>

I wanted to avoid triple * param but indeed it is not clear how to treat
returned NULL.


> And more generally, what is the use case? AFAICS, the function only uses
> public fields.


I didn't noticed it. Probably no need for such function. Thanks for
pointing that.


More information about the ffmpeg-devel mailing list