[FFmpeg-cvslog] avutil: add av_buffer_get_ref_count()

Michael Niedermayer git at videolan.org
Sat Mar 30 20:42:54 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Mar 30 19:13:26 2013 +0100| [dc92464aee01a78c9963f86f24600ddf9c825258] | committer: Michael Niedermayer

avutil: add av_buffer_get_ref_count()

This function is quite usefull for debuging

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc92464aee01a78c9963f86f24600ddf9c825258
---

 libavutil/buffer.c |    5 +++++
 libavutil/buffer.h |    2 ++
 2 files changed, 7 insertions(+)

diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index 20eaa73..a5fc8d7 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -130,6 +130,11 @@ void *av_buffer_get_opaque(const AVBufferRef *buf)
     return buf->buffer->opaque;
 }
 
+int av_buffer_get_ref_count(const AVBufferRef *buf)
+{
+    return buf->buffer->refcount;
+}
+
 int av_buffer_make_writable(AVBufferRef **pbuf)
 {
     AVBufferRef *newbuf, *buf = *pbuf;
diff --git a/libavutil/buffer.h b/libavutil/buffer.h
index ea49342..bcd1130 100644
--- a/libavutil/buffer.h
+++ b/libavutil/buffer.h
@@ -167,6 +167,8 @@ int av_buffer_is_writable(const AVBufferRef *buf);
  */
 void *av_buffer_get_opaque(const AVBufferRef *buf);
 
+int av_buffer_get_ref_count(const AVBufferRef *buf);
+
 /**
  * Create a writable reference from a given buffer reference, avoiding data copy
  * if possible.



More information about the ffmpeg-cvslog mailing list