#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.
*/
enum AVPictureType pict_type;
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
uint8_t *base[AV_NUM_DATA_POINTERS];
+#endif
/**
* Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
*/
int quality;
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
int reference;
/**
* QP table
*/
+ attribute_deprecated
int8_t *qscale_table;
/**
* QP store stride
*/
+ attribute_deprecated
int qstride;
+ attribute_deprecated
int qscale_type;
/**
* mbskip_table[mb]>=1 if MB didn't change
* stride= mb_width = (width+15)>>4
*/
+ attribute_deprecated
uint8_t *mbskip_table;
/**
* motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
* @endcode
*/
+ attribute_deprecated
int16_t (*motion_val[2])[2];
/**
* macroblock type table
* mb_type_base + mb_width + 2
*/
+ attribute_deprecated
uint32_t *mb_type;
/**
* DCT coefficients
*/
+ attribute_deprecated
short *dct_coeff;
/**
* motion reference frame index
* the order in which these are stored can depend on the codec.
*/
+ attribute_deprecated
int8_t *ref_index[2];
+#endif
/**
* for some private data of the user
*/
uint64_t error[AV_NUM_DATA_POINTERS];
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
int type;
+#endif
/**
* When decoding, this signals how much the picture must be delayed.
*/
int palette_has_changed;
+#if FF_API_AVFRAME_LAVC
+ attribute_deprecated
int buffer_hints;
/**
* Pan scan.
*/
+ attribute_deprecated
struct AVPanScan *pan_scan;
+#endif
/**
* reordered opaque 64bit (generally an integer or a double precision float
* @deprecated this field is unused
*/
attribute_deprecated void *hwaccel_picture_private;
-#endif
+ attribute_deprecated
struct AVCodecContext *owner;
+ attribute_deprecated
void *thread_opaque;
/**
* log2 of the size of the block which a single vector in motion_val represents:
* (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
*/
+ attribute_deprecated
uint8_t motion_subsample_log2;
+#endif
/**
* Sample rate of the audio data.
* Number of elements in extended_buf.
*/
int nb_extended_buf;
+
+ AVFrameSideData **side_data;
+ int nb_side_data;
} AVFrame;
/**
* 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);
*/
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(const AVFrame *frame,
+ enum AVFrameSideDataType type);
+
#endif /* AVUTIL_FRAME_H */