aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXidorn Quan <quanxunzhen@gmail.com>2013-03-29 23:15:19 +0800
committerMichael Niedermayer <michaelni@gmx.at>2013-03-29 17:31:16 +0100
commitc81d2fa96ddc9f6dab38d61a8803caca7e63bea0 (patch)
tree4f72f013668e57a5438790854b3fab9ed6d056e6
parent774a2684973ef66d80b77e657d3fe28e3f37c496 (diff)
downloadffmpeg-c81d2fa96ddc9f6dab38d61a8803caca7e63bea0.tar.gz
avutil/buffer: add get_opaque
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavutil/buffer.c5
-rw-r--r--libavutil/buffer.h7
-rw-r--r--libavutil/version.h4
3 files changed, 13 insertions, 3 deletions
diff --git a/libavutil/buffer.c b/libavutil/buffer.c
index bccf089aca..20eaa733f2 100644
--- a/libavutil/buffer.c
+++ b/libavutil/buffer.c
@@ -125,6 +125,11 @@ int av_buffer_is_writable(const AVBufferRef *buf)
return avpriv_atomic_int_get(&buf->buffer->refcount) == 1;
}
+void *av_buffer_get_opaque(const AVBufferRef *buf)
+{
+ return buf->buffer->opaque;
+}
+
int av_buffer_make_writable(AVBufferRef **pbuf)
{
AVBufferRef *newbuf, *buf = *pbuf;
diff --git a/libavutil/buffer.h b/libavutil/buffer.h
index e33775aee3..ea49342e0a 100644
--- a/libavutil/buffer.h
+++ b/libavutil/buffer.h
@@ -122,7 +122,7 @@ AVBufferRef *av_buffer_allocz(int size);
* @param data data array
* @param size size of data in bytes
* @param free a callback for freeing data
- * @param opaque parameter to be passed to free
+ * @param opaque parameter to be got for processing or passed to free
* @param flags a combination of AV_BUFFER_FLAG_*
*
* @return an AVBufferRef referring to data on success, NULL on failure.
@@ -163,6 +163,11 @@ void av_buffer_unref(AVBufferRef **buf);
int av_buffer_is_writable(const AVBufferRef *buf);
/**
+ * @return the opaque parameter set by av_buffer_create.
+ */
+void *av_buffer_get_opaque(const AVBufferRef *buf);
+
+/**
* Create a writable reference from a given buffer reference, avoiding data copy
* if possible.
*
diff --git a/libavutil/version.h b/libavutil/version.h
index ee99008b7a..5bb3d0718b 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -75,8 +75,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 22
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR 23
+#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \