On 04/07/2011 06:54 AM, Janne Grunau wrote:
> On Wed, Apr 06, 2011 at 10:26:08PM +0200, Kostya Shishkov wrote:
>> This adds side information to AVPacket
>>
>> ---
>> libavcodec/avcodec.h | 21 +++++++++++++++++++++
>> libavcodec/avpacket.c | 39 +++++++++++++++++++++++++++++++++++++++
>> libavcodec/version.h | 2 +-
>> 3 files changed, 61 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
>> index 95a933d..4b7bedc 100644
>> --- a/libavcodec/avcodec.h
>> +++ b/libavcodec/avcodec.h
>> @@ -1054,6 +1054,14 @@ typedef struct AVPacket {
>> int64_t dts;
>> uint8_t *data;
>> int size;
>> + /**
>> + * Additional packet data that may be provided by container. If present
>> + * it should declare side data type and size.
>> + */
>> + uint8_t *side_data;
>> + int side_data_size;
>> + int side_data_type;
>> +
>> int stream_index;
>> int flags;
>> /**
>> @@ -1089,6 +1097,9 @@ typedef struct AVPacket {
>> #define PKT_FLAG_KEY AV_PKT_FLAG_KEY
>> #endif
>>
>> +#define AV_PKT_DATA_NONE 0 ///< no packet side information
>> +#define AV_PKT_DATA_PAL 1 ///< packet side information contains new palette
>
> enum?
>
>> +
>> /**
>> * Audio Video Frame.
>> * New fields can be added to the end of FF_COMMON_FRAME with minor version
>> @@ -3190,6 +3201,16 @@ void av_shrink_packet(AVPacket *pkt, int size);
>> int av_grow_packet(AVPacket *pkt, int grow_by);
>>
>> /**
>> + * Allocate the side information of a packet.
>> + *
>> + * @param pkt packet
>> + * @param type side information type (AV_PKT_DATA_*)
>> + * @param size wanted side information size
>> + * @return 0 if OK, AVERROR_xxx otherwise
>> + */
>> +int av_new_packet_side_data(AVPacket *pkt, int type, int size);
>
> av_packet_new_side_data() is less confusing
I'd rather have avpacket_ as namespace.
lu
--
Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel