Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2017-02-02 13:27:54 +0300
committerwm4 <nfxjfg@googlemail.com>2017-02-13 10:01:20 +0300
commite3af49b14bf371e18fab1c12cba0239e6658672c (patch)
tree78b3f9c04691772d3708fc7662aae33888ed32d1 /libavutil/frame.h
parent2b9f92fcc5486361b63c4fab5a24c222dc8969ef (diff)
AVFrame: add an opaque_ref field
This is an extended version of the AVFrame.opaque field, which can be used to attach arbitrary user information to an AVFrame. The usefulness of the opaque field is rather limited, because it can store only up to 32 bits of information (or 64 bit on 64 bit systems). It's not possible to set this field to a memory allocation, because there is no way to deallocate it correctly. The opaque_ref field circumvents this by letting the user set an AVBuffer, which makes the user data refcounted. Signed-off-by: Anton Khirnov <anton@khirnov.net> Merges Libav commit 04f3bd349651.
Diffstat (limited to 'libavutil/frame.h')
-rw-r--r--libavutil/frame.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavutil/frame.h b/libavutil/frame.h
index b4500923af..2b1dc2fee3 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -538,6 +538,17 @@ typedef struct AVFrame {
* AVHWFramesContext describing the frame.
*/
AVBufferRef *hw_frames_ctx;
+
+ /**
+ * AVBufferRef for free use by the API user. FFmpeg will never check the
+ * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when
+ * the frame is unreferenced. av_frame_copy_props() calls create a new
+ * reference with av_buffer_ref() for the target frame's opaque_ref field.
+ *
+ * This is unrelated to the opaque field, although it serves a similar
+ * purpose.
+ */
+ AVBufferRef *opaque_ref;
} AVFrame;
/**