summaryrefslogtreecommitdiff
path: root/libavutil/fifo.h
diff options
context:
space:
mode:
authorBjörn Axelsson <gecko@acc.umu.se>2008-04-09 11:35:16 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2008-04-09 11:35:16 +0000
commit49cec1998af4c8806f4981d12daa28091ccb0425 (patch)
tree557a347c0c4964b8b9f4c2349b154062f84d6f9e /libavutil/fifo.h
parent96275520a383464ce9552ed727bd38dcb91d70fb (diff)
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 Originally committed as revision 12773 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/fifo.h')
-rw-r--r--libavutil/fifo.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 817a8a6b61..fccb322dbf 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -76,7 +76,21 @@ int av_fifo_generic_read(AVFifoBuffer *f, int buf_size, void (*func)(void*, void
* @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.