Browse Source

avutil: add av_buffer_get_ref_count()

This function is quite usefull for debuging

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.0
Michael Niedermayer 12 years ago
parent
commit
dc92464aee
2 changed files with 7 additions and 0 deletions
  1. +5
    -0
      libavutil/buffer.c
  2. +2
    -0
      libavutil/buffer.h

+ 5
- 0
libavutil/buffer.c View File

@@ -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;


+ 2
- 0
libavutil/buffer.h View File

@@ -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.


Loading…
Cancel
Save