aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/frame.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-08 23:55:00 +0100
committerTimo Rothenpieler <timo@rothenpieler.org>2017-11-10 16:44:17 +0100
commit1fa3a9a31de11a2dee0efc75b89862e80ab3c90f (patch)
tree6a6ac3856ec0fbb1378a5111dc37edad93181d6d /libavutil/frame.h
parentdd435c957aa48349f25c58bac88010d5af696227 (diff)
downloadffmpeg-1fa3a9a31de11a2dee0efc75b89862e80ab3c90f.tar.gz
avutil/frame: Add private_ref to AVFrame
This gives FFmpeg libs a field that they can freely and safely use. Avoiding the need of wrapping of a users opaque_ref field and its issues. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/frame.h')
-rw-r--r--libavutil/frame.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 0c6aab1c02..d54bd9a354 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -563,6 +563,19 @@ typedef struct AVFrame {
/**
* @}
*/
+
+ /**
+ * AVBufferRef for internal use by a single libav* library.
+ * Must not be used to transfer data between libraries.
+ * Has to be NULL when ownership of the frame leaves the respective library.
+ *
+ * Code outside the FFmpeg libs should never check or change 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 private_ref field.
+ */
+ AVBufferRef *private_ref;
} AVFrame;
#if FF_API_FRAME_GET_SET