[FFmpeg-devel] [PATCH 3/4] lavfi/timeline: add passthrough callback.

Clément Bœsch ubitux at gmail.com
Tue Apr 16 03:35:05 CEST 2013


On Tue, Apr 16, 2013 at 12:33:58AM +0200, Michael Niedermayer wrote:
> On Mon, Apr 15, 2013 at 06:56:37PM +0200, Clément Bœsch wrote:
> > ---
> >  libavfilter/avfilter.c |  3 ++-
> >  libavfilter/avfilter.h | 13 +++++++++++++
> >  2 files changed, 15 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> > index 8a5292d..65e04e7 100644
> > --- a/libavfilter/avfilter.c
> > +++ b/libavfilter/avfilter.c
> > @@ -959,7 +959,8 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
> >          dstctx->var_values[VAR_N] = link->frame_count;
> >          dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
> >          if (!((int)av_expr_eval(dstctx->enable, dstctx->var_values, NULL)))
> > -            filter_frame = default_filter_frame;
> > +            filter_frame = dst->passthrough_filter_frame ? dst->passthrough_filter_frame

> > +                                                         : default_filter_name;

Note: this embarrassing mistake from completion abused is obviously fixed
locally.

> >      }
> >      ret = filter_frame(link, out);
> >      link->frame_count++;
> > diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> > index a5518f7..a092ad2 100644
> > --- a/libavfilter/avfilter.h
> > +++ b/libavfilter/avfilter.h
> > @@ -336,6 +336,19 @@ struct AVFilterPad {
> >      int (*filter_frame)(AVFilterLink *link, AVFrame *frame);
> >  
> >      /**
> > +     * Passthrough filtering callback.
> > +     *
> > +     * If a filter support timeline editing (AVFILTER_FLAG_SUPPORT_TIMELINE)
> > +     * then it can implement a custom passthrough callback to update its local
> > +     * context (for example to keep a frame reference, or simply send the
> > +     * filter to a custom outlink). The filter is obviously not supposed to do
> > +     * any change to the frame in this callback.
> > +     *
> > +     * Input pads only.
> > +     */
> > +    int (*passthrough_filter_frame)(AVFilterLink *link, AVFrame *frame);
> > +
> > +    /**
> >       * Frame poll callback. This returns the number of immediately available
> 
> shouldnt new fields be added at the end of the structure ?
> 

There is this a bit above:

    /*****************************************************************
     * All fields below this line are not part of the public API. They
     * may not be used outside of libavfilter and can be changed and
     * removed at will.
     * New public fields should be added right above.
     *****************************************************************
     */

...and since there was at least one recent commit messing it, I assumed it was
safe.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130416/3a1f4bc5/attachment.asc>


More information about the ffmpeg-devel mailing list