[FFmpeg-devel] [PATCH] vsrc_buffer.h: remove API dependency on libavcodec/AVFrame
Michael Niedermayer
michaelni at gmx.at
Sun Apr 3 23:12:37 CEST 2011
On Sun, Apr 03, 2011 at 09:10:36PM +0200, Stefano Sabatini wrote:
> 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
> ffmpeg.c | 18 ++++++++++++++----
> libavfilter/vsrc_buffer.c | 45 ++++++++++-----------------------------------
> libavfilter/vsrc_buffer.h | 11 +++++++++--
> 3 files changed, 33 insertions(+), 41 deletions(-)
> 89727dc9a1c501593813419aeab03714166fa07e 0004-vsrc_buffer.h-remove-API-dependency-on-libavcodec-AV.patch
> From e430533207909f5232e0b4fc7ba47338ca8b9a1b Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sun, 3 Apr 2011 17:12:06 +0200
> Subject: [PATCH] vsrc_buffer.h: remove API dependency on libavcodec/AVFrame
>
> Allow the source to be used in a pure libavfilter application.
>
> This is done by providing an AVFilterBufferRef to
> av_vsrc_buffer_add_frame(). AVFrame -> AVFilterBufferRef field mapping
> is done in the application.
good idea
but see av_vsrc_buffer_add_frame2() it seems ive broken your patch ...
also, iam not 100% happy about requireing user apps to do this mapping
but i dont want to hold your work up
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110403/279ed939/attachment.asc>
More information about the ffmpeg-devel
mailing list