[FFmpeg-cvslog] r18321 - in trunk/libavutil: avutil.h fifo.c fifo.h

stefano subversion
Fri Apr 3 01:22:19 CEST 2009


Author: stefano
Date: Fri Apr  3 01:22:19 2009
New Revision: 18321

Log:
Implement av_fifo_space().

Patch by Olivier Guilyardi list et samalyse DOT c0m.

Modified:
   trunk/libavutil/avutil.h
   trunk/libavutil/fifo.c
   trunk/libavutil/fifo.h

Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h	Fri Apr  3 00:41:58 2009	(r18320)
+++ trunk/libavutil/avutil.h	Fri Apr  3 01:22:19 2009	(r18321)
@@ -35,7 +35,7 @@
 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
 
 #define LIBAVUTIL_VERSION_MAJOR 50
-#define LIBAVUTIL_VERSION_MINOR  2
+#define LIBAVUTIL_VERSION_MINOR  3
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Modified: trunk/libavutil/fifo.c
==============================================================================
--- trunk/libavutil/fifo.c	Fri Apr  3 00:41:58 2009	(r18320)
+++ trunk/libavutil/fifo.c	Fri Apr  3 01:22:19 2009	(r18321)
@@ -54,6 +54,11 @@ int av_fifo_size(AVFifoBuffer *f)
     return (uint32_t)(f->wndx - f->rndx);
 }
 
+int av_fifo_space(AVFifoBuffer *f)
+{
+    return f->end - f->buffer - av_fifo_size(f);
+}
+
 int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size) {
     unsigned int old_size= f->end - f->buffer;
 

Modified: trunk/libavutil/fifo.h
==============================================================================
--- trunk/libavutil/fifo.h	Fri Apr  3 00:41:58 2009	(r18320)
+++ trunk/libavutil/fifo.h	Fri Apr  3 01:22:19 2009	(r18321)
@@ -62,6 +62,14 @@ void av_fifo_reset(AVFifoBuffer *f);
 int av_fifo_size(AVFifoBuffer *f);
 
 /**
+ * Returns the amount of space in bytes in the AVFifoBuffer, that is the
+ * amount of data you can write into it.
+ * @param *f AVFifoBuffer to write into
+ * @return size
+ */
+int av_fifo_space(AVFifoBuffer *f);
+
+/**
  * Feeds data from an AVFifoBuffer to a user-supplied callback.
  * @param *f AVFifoBuffer to read from
  * @param buf_size number of bytes to read



More information about the ffmpeg-cvslog mailing list