diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2011-04-09 15:31:39 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2011-04-15 18:01:53 +0200 |
commit | 4de339e219908ff44cbb1d823edeeead3b8facda (patch) | |
tree | f9e527838d9c2d492474fa864ae88789f5b5cb15 /libavcodec/avcodec.h | |
parent | 4d012eb541ed7f35e00c87035a470d9f0a24a6e8 (diff) | |
download | ffmpeg-4de339e219908ff44cbb1d823edeeead3b8facda.tar.gz |
introduce side information for AVPacket
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 109d2a4923..df4e61798e 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1035,6 +1035,10 @@ typedef struct AVPanScan{ #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content. #define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update). +enum AVPacketSideDataType { + AV_PKT_DATA_PALETTE, +}; + typedef struct AVPacket { /** * Presentation timestamp in AVStream->time_base units; the time at which @@ -1057,6 +1061,17 @@ typedef struct AVPacket { int stream_index; int flags; /** + * Additional packet data that can be provided by the container. + * Packet can contain several types of side information. + */ + struct { + uint8_t *data; + int size; + enum AVPacketSideDataType type; + } *side_data; + int side_data_elems; + + /** * Duration of this packet in AVStream->time_base units, 0 if unknown. * Equals next_pts - this_pts in presentation order. */ @@ -3202,6 +3217,28 @@ int av_dup_packet(AVPacket *pkt); */ void av_free_packet(AVPacket *pkt); +/** + * Allocate new information of a packet. + * + * @param pkt packet + * @param type side information type + * @param size side information size + * @return pointer to fresh allocated data or NULL otherwise + */ +uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int size); + +/** + * Get side information from packet. + * + * @param pkt packet + * @param type desired side information type + * @param size pointer for side information size to store (optional) + * @return pointer to data if present or NULL otherwise + */ +uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int *size); + /* resample.c */ struct ReSampleContext; |