[FFmpeg-devel] [PATCH] vsrc_buffer.h: remove API dependency on libavcodec/AVFrame

Stefano Sabatini stefano.sabatini-lala at poste.it
Sun Apr 3 21:10:36 CEST 2011


On date Sunday 2011-04-03 18:07:31 +0200, Michael Niedermayer encoded:
> On Sun, Apr 03, 2011 at 05:56:01PM +0200, Stefano Sabatini wrote:
> > Allow the source to be used in a pure libavfilter application.
> > 
> > A source integrated with libavcodec (a la ffplay.c:input_filter)
> > should be implemented independently.
> > 
> > Signed-off-by: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> > ---
> >  ffmpeg.c                  |    5 ++++-
> >  libavfilter/vsrc_buffer.c |   23 ++++++++++++++---------
> >  libavfilter/vsrc_buffer.h |    5 +++--
> >  3 files changed, 21 insertions(+), 12 deletions(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index 2a7431c..b582b1e 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -1624,7 +1624,10 @@ static int output_packet(AVInputStream *ist, int ist_index,
> >                      if (ist->st->sample_aspect_ratio.num) sar = ist->st->sample_aspect_ratio;
> >                      else                                  sar = ist->st->codec->sample_aspect_ratio;
> >                      // add it to be filtered
> > -                    av_vsrc_buffer_add_frame(ost->input_video_filter, &picture,
> > +                    av_vsrc_buffer_add_frame(ost->input_video_filter,
> > +                                             picture.data, picture.linesize,
> > +                                             picture.interlaced_frame,
> > +                                             picture.top_field_first,
> >                                               ist->pts,
> >                                               sar);
> 
> With AVFrame fields can be added, with a function like this they
> cannot.
> And i think we will want to access quite a few other fields from
> AVFrame. For example in filters to vissualize motion vectors, mb types
> and many other things

My point is making vsrc_buffer non-depending on libavcodec API, and
making the API allows to propagate whatever information is read by
filters (with no changes in API). Check the new patch.

As for the motion vectors and MB types, this would imply to add some
fields to AVFilterBufferRefVideoProps, so I'm not sure it is a good
idea (but at least the picture type may be useful).
-- 
FFmpeg = Free and Friendly Mind-dumbing Portable Epic Guru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-vsrc_buffer.h-remove-API-dependency-on-libavcodec-AV.patch
Type: text/x-diff
Size: 6806 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110403/1c2fc152/attachment.bin>


More information about the ffmpeg-devel mailing list