* A very simple circular buffer FIFO implementation.
*/
-#ifndef FFMPEG_FIFO_H
-#define FFMPEG_FIFO_H
+#ifndef AVUTIL_FIFO_H
+#define AVUTIL_FIFO_H
#include <stdint.h>
+#include "common.h"
typedef struct AVFifoBuffer {
uint8_t *buffer;
* @param size of FIFO
* @return <0 for failure >=0 otherwise
*/
-int av_fifo_init(AVFifoBuffer *f, int size);
+int av_fifo_init(AVFifoBuffer *f, unsigned int size);
/**
* Frees an AVFifoBuffer.
*/
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int));
+#if LIBAVUTIL_VERSION_MAJOR < 50
/**
* Resizes an AVFifoBuffer.
* @param *f AVFifoBuffer to resize
* @param size new AVFifoBuffer size in bytes
+ * @see av_fifo_realloc2()
*/
-void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
+attribute_deprecated void av_fifo_realloc(AVFifoBuffer *f, unsigned int size);
+#endif
+
+/**
+ * Resizes an AVFifoBuffer.
+ * @param *f AVFifoBuffer to resize
+ * @param size new AVFifoBuffer size in bytes
+ * @return <0 for failure >=0 otherwise
+ */
+int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size);
/**
* Reads and discards the specified amount of data from an AVFifoBuffer.
ptr -= f->end - f->buffer;
return *ptr;
}
-#endif /* FFMPEG_FIFO_H */
+#endif /* AVUTIL_FIFO_H */