[FFmpeg-devel] [RFC][PATCH] av_fifo_write_from_bytestream()

Björn Axelsson bjorn.axelsson
Wed Apr 9 12:20:29 CEST 2008


On Wed, 2008-04-09 at 08:40 +0200, Benoit Fouet wrote:
> Hi,
> 
> Bj?rn Axelsson wrote:
> > Index: libavutil/fifo.h
> > ===================================================================
> > --- libavutil/fifo.h.orig	2008-04-03 13:25:00.000000000 +0200
> > +++ libavutil/fifo.h	2008-04-07 13:31:26.837042804 +0200
> > @@ -76,7 +76,21 @@
> >   * @param *buf data source
> >   * @param size data size
> >   */
> > -void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
> > +attribute_deprecated void av_fifo_write(AVFifoBuffer *f, const uint8_t *buf, int size);
> > +
> > +/**
> > + * Feeds data from a user supplied callback to an AVFifoBuffer.
> > + * @param *f AVFifoBuffer to write to
> > + * @param *buf data source
> > + * @param size number of bytes to write
> > + * @param *func generic write function. First parameter is buf,
> > + * second is dest_buf, third is dest_buf_size.
> > + * func must return the number of bytes written to dest_buf, or <= 0 to
> > + * indicate no more data available to write.
> > + * If func is NULL, buf is interpreted as a simple byte array for source data.
> > + * @return the number of bytes written to the fifo.
> > + */
> > +int av_fifo_generic_write(AVFifoBuffer *f, void *buf, int size, int (*func)(void*, void*, int));
> >   
> 
> why is buf not const ? (same applies for the first argument of func)

Because it isn't always a buffer. If buf is a ByteIOContext, having it
const is probably not a good idea.

-- 
Bj?rn Axelsson                    Phone: +46-(0)90-18 98 97
Intinor AB                          Fax: +46-(0)920-757 10
www.intinor.se
Interactive Television & Digital Media Distribution





More information about the ffmpeg-devel mailing list