[FFmpeg-devel] [PATCH 1/4] Implement avfilter_ref_video_buffer().

Stefano Sabatini stefano.sabatini-lala
Thu Nov 11 23:21:58 CET 2010


On date Thursday 2010-11-11 20:04:43 +0100, Michael Niedermayer encoded:
> On Wed, Nov 10, 2010 at 09:16:29PM +0100, Stefano Sabatini wrote:
> > On date Wednesday 2010-11-10 16:21:18 +0100, Michael Niedermayer encoded:
> > > On Tue, Nov 09, 2010 at 11:28:04PM +0100, Stefano Sabatini wrote:
> > > > On date Tuesday 2010-11-09 19:39:16 +0100, Michael Niedermayer encoded:
> > > > > On Sat, Nov 06, 2010 at 11:09:05PM +0100, Stefano Sabatini wrote:
> > > > > > ---
> > > > > >  libavfilter/avfilter.c |   38 +++++++++++++++++++++++++++++++++++++
> > > > > >  libavfilter/avfilter.h |   14 +++++++++++++
> > > > > >  libavfilter/defaults.c |   49 ++++++++++++++---------------------------------
> > > > > >  3 files changed, 67 insertions(+), 34 deletions(-)
> > > > [...]
> > > > > > --- a/libavfilter/avfilter.h
> > > > > > +++ b/libavfilter/avfilter.h
> > > > > > @@ -649,6 +649,20 @@ AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms,
> > > > > >                                            int w, int h);
> > > > > >  
> > > > > >  /**
> > > > > > + * Create a video buffer reference wrapped around an already allocated
> > > > > > + * image.
> > > > > > + *
> > > > > > + * @param data pointers to the planes of the image to reference
> > > > > > + * @param linesize linesizes for the planes of the image to reference
> > > > > > + * @param perms the required access permissions
> > > > > > + * @param w the width of the image in data
> > > > > > + * @param h the height of the image in data
> > > > > > + * @param format the pixel format of the image in data
> > > > > > + */
> > > > > > +AVFilterBufferRef *avfilter_ref_video_buffer(uint8_t *data[4], int linesize[4], int perms,
> > > > > > +                                             int w, int h, enum PixelFormat format);
> > > > > 
> > > > > that function name is nothing but bad
> > > > > 
> > > > > avfilter_given_picture_to_ref() is a random better one
> > > > 
> > > > well we have a video buffer and we want a reference from them, and I
> > > > wanted something similar to:
> > > > 
> > > > avfilter_get_video_buffer()
> > > > so
> > > > avfilter_ref_video_buffer()
> > > 
> > > we have avfilter_ref_buffer() with totally different semantics
> > > 
> > > 
> > > 
> > > > 
> > > > Other ideas:
> > > > avfilter_get_video_buffer_ref()
> > > 
> > > > avfilter_get_video_buffer_ref_from_image()
> > > 
> > > thats the only where the name is not saying something completely different from
> > > what the function does.
> > > 
> > > i suggest:
> > > avfilter_arrays_to_video_buffer_ref()
> > 
> > I find this name not very informative (what do the arrays contain?),
> 
> well, to me its quite clear but feel free to call it pixel_arrays
> 
> 
> > so I have a preference for avfilter_get_video_buffer_ref_from_image(),
> > which is a bit long but more explicative.
> 
> image in this context says nothing. That can be an arbitrary struct representing
> an image or a AVBufferRef or whatever, it certainly does not hint toward raw
> data/linesize arrays

AVBufferRef should never be referenced in that way but using
avfilter_ref_buffer(), and I have no idea what else it should
represent a data+linesize passed to such a function, also the idea:
data[4]+linesize[4] ~ image
should be clear and familiar from the imgutils.h API.

"pixel_arrays" sounds awkward and less clear to me.
-- 
FFmpeg = Fabulous Funny Mega Pure Extensive Genius



More information about the ffmpeg-devel mailing list