aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/frame.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-12-25 22:11:36 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 07:37:01 +0100
commit77b2cd7b41d7ec8008b6fac753c04f77824c514c (patch)
tree67016b52528cb2564f8ab5075d3814e29c12170d /libavutil/frame.h
parent7ecc2d403ce5c7b6ea3b1f368dccefd105209c7e (diff)
downloadffmpeg-77b2cd7b41d7ec8008b6fac753c04f77824c514c.tar.gz
AVFrame: add side data.
Diffstat (limited to 'libavutil/frame.h')
-rw-r--r--libavutil/frame.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/libavutil/frame.h b/libavutil/frame.h
index ed410ba122..5e50aae11a 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -26,9 +26,23 @@
#include "avutil.h"
#include "buffer.h"
+#include "dict.h"
#include "rational.h"
#include "samplefmt.h"
+enum AVFrameSideDataType {
+ /**
+ * The data is the AVPanScan struct defined in libavcodec.
+ */
+ AV_FRAME_DATA_PANSCAN,
+};
+
+typedef struct AVFrameSideData {
+ enum AVFrameSideDataType type;
+ uint8_t *data;
+ int size;
+ AVDictionary *metadata;
+} AVFrameSideData;
/**
* This structure describes decoded (raw) audio or video data.
@@ -306,6 +320,9 @@ typedef struct AVFrame {
* Number of elements in extended_buf.
*/
int nb_extended_buf;
+
+ AVFrameSideData **side_data;
+ int nb_side_data;
} AVFrame;
/**
@@ -413,6 +430,7 @@ int av_frame_make_writable(AVFrame *frame);
* Metadata for the purpose of this function are those fields that do not affect
* the data layout in the buffers. E.g. pts, sample rate (for audio) or sample
* aspect ratio (for video), but not width/height or channel layout.
+ * Side data is also copied.
*/
int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
@@ -426,4 +444,24 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
*/
AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
+/**
+ * Add a new side data to a frame.
+ *
+ * @param frame a frame to which the side data should be added
+ * @param type type of the added side data
+ * @param size size of the side data
+ *
+ * @return newly added side data on success, NULL on error
+ */
+AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
+ enum AVFrameSideDataType type,
+ int size);
+
+/**
+ * @return a pointer to the side data of a given type on success, NULL if there
+ * is no side data with such type in this frame.
+ */
+AVFrameSideData *av_frame_get_side_data(AVFrame *frame,
+ enum AVFrameSideDataType type);
+
#endif /* AVUTIL_FRAME_H */