From 31c51f7441de07b88cfea2550245bf1f5140cb8f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 4 Oct 2015 12:08:20 +0200 Subject: avpacket: add a function for wrapping existing data as side data --- libavcodec/avcodec.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libavcodec/avcodec.h') diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index e888952d4d..5ed13de81c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3556,6 +3556,22 @@ void av_free_packet(AVPacket *pkt); uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size); +/** + * Wrap an existing array as a packet side data. + * + * @param pkt packet + * @param type side information type + * @param data the side data array. It must be allocated with the av_malloc() + * family of functions. The ownership of the data is transferred to + * pkt. + * @param size side information size + * @return a non-negative number on success, a negative AVERROR code on + * failure. On failure, the packet is unchanged and the data remains + * owned by the caller. + */ +int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + uint8_t *data, size_t size); + /** * Shrink the already allocated side data buffer * -- cgit v1.2.3