[FFmpeg-devel] [PATCH] lavu/imgutils: create misc functions for dealing with buffers

Stefano Sabatini stefasab at gmail.com
Tue Jun 19 18:07:40 CEST 2012


On date Tuesday 2012-06-19 15:14:18 +0200, Michael Niedermayer encoded:
> On Tue, Jun 19, 2012 at 01:48:27PM +0200, Stefano Sabatini wrote:
> > Move the lavc/imgconvert functions and rename them as follows:
> > avpicture_get_size -> av_image_get_size()
> > avpicture_fill     -> av_image_fill()
> > avpicture_layout   -> av_image_fill_buffer()
> > 
> > The new functions have an align parameter, which allows to define the
> > alignment buffer in the buffer (which is set or read).
[...]
> > + */
> > +int av_image_get_size(enum PixelFormat pix_fmt, int width, int height, int align);
> > +
> > +/**
> > + * Copy image data from an image into a buffer.
> 
> why is the function not called ...copy... ?

We have already av_image_copy().

Bikeshed time: the patchset now contains the names:

av_image_fill()        fill data/linesize given a buffer
av_image_fill_buffer() copy data to a buffer
av_image_get_size()    return the size required for a buffer to contain a given image

Alternatives for av_image_fill():
av_image_fill_from_buffer()
av_image_fill_arrays_from_buffer()
av_image_fill_arrays()

Alternatives for av_image_fill_buffer() (which now I realize is a bad
name):
av_image_copy_to_buffer()

Alternatives for av_image_get_size():
av_image_get_buffer_size()

My personal choice is for:
av_image_fill_arrays()
av_image_copy_to_buffer()
av_image_get_buffer_size()

which is also consistent with the samplefmt API.
-- 
FFmpeg = Frightening and Foolish Magical Pure Elegant Gorilla


More information about the ffmpeg-devel mailing list