diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-08 20:41:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-08 20:41:41 +0100 |
commit | 307dc32a1a7152ebacdcf9a0e58226f786ac639a (patch) | |
tree | bb770b3a3e958e762876fa395b0c7e2d114436f0 /libavutil/frame.h | |
parent | c4e8821732999f720535bb2eb1e8c7f1ea1db18f (diff) | |
parent | 77b2cd7b41d7ec8008b6fac753c04f77824c514c (diff) | |
download | ffmpeg-307dc32a1a7152ebacdcf9a0e58226f786ac639a.tar.gz |
Merge commit '77b2cd7b41d7ec8008b6fac753c04f77824c514c'
* commit '77b2cd7b41d7ec8008b6fac753c04f77824c514c':
AVFrame: add side data.
Conflicts:
libavutil/frame.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/frame.h')
-rw-r--r-- | libavutil/frame.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libavutil/frame.h b/libavutil/frame.h index 37b8032b97..26cb31c758 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. @@ -310,6 +324,9 @@ typedef struct AVFrame { */ int nb_extended_buf; + AVFrameSideData **side_data; + int nb_side_data; + /** * frame timestamp estimated using various heuristics, in stream time base * Code outside libavcodec should access this field using: @@ -510,6 +527,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); @@ -523,4 +541,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 */ |