Mercurial > libavutil.hg
diff fifo.h @ 492:75f096258d14 libavutil
Add a generic write function to av_fifo.
Patch by Bj«Órn Axelsson: bjorn axelsson intinor se
Original thread: [FFmpeg-devel] [RFC][PATCH] av_fifo_write_from_bytestream()
Date: 04/03/2008 12:14 PM
author | benoit |
---|---|
date | Wed, 09 Apr 2008 11:35:16 +0000 |
parents | d0f3bb6e367e |
children | 97dd9756349c |
line wrap: on
line diff
--- a/fifo.h Mon Apr 07 21:16:31 2008 +0000 +++ b/fifo.h Wed Apr 09 11:35:16 2008 +0000 @@ -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)); /** * Resizes an AVFifoBuffer.