[FFmpeg-devel] [PATCH] make fifo allocate AVFifoBuffer
Reimar Döffinger
Reimar.Doeffinger
Sun Mar 8 09:25:50 CET 2009
On Sun, Mar 08, 2009 at 08:43:18AM +0100, Reimar D?ffinger wrote:
> On Sun, Mar 08, 2009 at 02:41:05AM +0100, Michael Niedermayer wrote:
> > Patch below should reduce future API/ABI issues with fifo.c/h changes.
> >
> > Does anyone want me to bump major for this?
>
> If you don't bump libavutil major, people will have a hard time keeping
> libavformat from the previous major version around.
> Also avfifo_read should be removed if major version is bumped.
Here's a patch for that, though it may be a bit overkill if it will be
removed really soon.
-------------- next part --------------
Index: libavutil/fifo.c
===================================================================
--- libavutil/fifo.c (revision 17868)
+++ libavutil/fifo.c (working copy)
@@ -43,10 +43,12 @@
return (uint32_t)(f->wndx - f->rndx);
}
+#if LIBAVUTIL_VERSION_MAJOR < 50
int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size)
{
return av_fifo_generic_read(f, buf_size, NULL, buf);
}
+#endif
#if LIBAVUTIL_VERSION_MAJOR < 50
void av_fifo_realloc(AVFifoBuffer *f, unsigned int new_size) {
Index: libavutil/fifo.h
===================================================================
--- libavutil/fifo.h (revision 17868)
+++ libavutil/fifo.h (working copy)
@@ -56,13 +56,15 @@
*/
int av_fifo_size(AVFifoBuffer *f);
+#if LIBAVUTIL_VERSION_MAJOR < 50
/**
* Reads data from an AVFifoBuffer.
* @param *f AVFifoBuffer to read from
* @param *buf data destination
* @param buf_size number of bytes to read
*/
-int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
+attribute_deprecated int av_fifo_read(AVFifoBuffer *f, uint8_t *buf, int buf_size);
+#endif
/**
* Feeds data from an AVFifoBuffer to a user-supplied callback.
More information about the ffmpeg-devel
mailing list