Ported patch from ffmpeg:
author Xidorn Quan <quanxunzhen@gmail.com>
Fri, 29 Mar 2013 17:15:19 +0200 (23:15 +0800)
committer Michael Niedermayer <michaelni@gmx.at>
Fri, 29 Mar 2013 18:31:16 +0200 (17:31 +0100)
commit
c81d2fa96ddc9f6dab38d61a8803caca7e63bea0
avutil/buffer: add get_opaque
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Change-Id: I456b163a92e2f87c7c4148bfb68f0f610194f3a5
Signed-off-by: Michal Jurkiewicz <m.jurkiewicz@samsung.com>
(cherry picked from commit
40bec43a69561bba5c3914d762813f32a7e1983f)
return avpriv_atomic_int_add_and_fetch(&buf->buffer->refcount, 0) == 1;
}
+void *av_buffer_get_opaque(const AVBufferRef *buf)
+{
+ return buf->buffer->opaque;
+}
+
int av_buffer_make_writable(AVBufferRef **pbuf)
{
AVBufferRef *newbuf, *buf = *pbuf;
* @param data data array
* @param size size of data in bytes
* @param free a callback for freeing this buffer's 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.
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.
*