[FFmpeg-devel] [PATCH 1/3] lavfi: add frame counter into AVFilterLink and use it in filters.

Clément Bœsch ubitux at gmail.com
Sat Apr 20 15:22:54 CEST 2013


On Sat, Apr 20, 2013 at 11:17:41AM +0200, Stefano Sabatini wrote:
> On date Friday 2013-04-19 00:28:52 +0200, Clément Bœsch encoded:
> > ---
> >  libavfilter/avfilter.c          | 1 +
> >  libavfilter/avfilter.h          | 5 +++++
> >  libavfilter/f_select.c          | 2 +-
> >  libavfilter/vf_blackdetect.c    | 6 ++----
> >  libavfilter/vf_blend.c          | 3 +--
> >  libavfilter/vf_crop.c           | 3 +--
> >  libavfilter/vf_decimate.c       | 3 +--
> >  libavfilter/vf_drawtext.c       | 7 +++----
> >  libavfilter/vf_fieldmatch.c     | 8 +++-----
> >  libavfilter/vf_framestep.c      | 4 ++--
> >  libavfilter/vf_geq.c            | 2 +-
> >  libavfilter/vf_hue.c            | 3 +--
> >  libavfilter/vf_overlay.c        | 2 +-
> >  libavfilter/vf_separatefields.c | 6 +++---
> >  libavfilter/vf_telecine.c       | 3 +--
> >  15 files changed, 27 insertions(+), 31 deletions(-)
> > 
> > diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
> > index f392613..43340d1 100644
> > --- a/libavfilter/avfilter.c
> > +++ b/libavfilter/avfilter.c
> > @@ -915,6 +915,7 @@ static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
> >  
> >      pts = out->pts;
> >      ret = filter_frame(link, out);
> > +    link->frame_count++;
> >      link->frame_requested = 0;
> >      ff_update_link_current_pts(link, pts);
> >      return ret;
> > diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> > index 0b970d0..38bc5ee 100644
> > --- a/libavfilter/avfilter.h
> > +++ b/libavfilter/avfilter.h
> > @@ -718,6 +718,11 @@ struct AVFilterLink {
> >       * Link processing flags.
> >       */
> >      unsigned flags;
> > +
> 
> > +    /**
> > +     * Number of frames a link has seen
> > +     */
> > +    int64_t frame_count;
> 
> Description is a bit idiomatic (a link can't "see"), also I'm not sure
> it is accurate since the frame_count is updated *after* a frame has
> been passed through the link.
> 
> I suggest:
> number of past frames sent through the link
> 

OK. I used the Caps+period form (even if it's not a sentence) for
consistency with all the other doxy of the struct.

> LGTM otherwise, thanks.

-- 
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/20130420/3b2e0caa/attachment.asc>


More information about the ffmpeg-devel mailing list