avpacket: add pack/unpack functions for AVDictionary

These functions are intended for use with side_data which comes in an
AVPacket.

Signed-off-by: Ben Boeckel <mathstuf@gmail.com>
Reviewed-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Ben Boeckel
2013-11-17 20:36:26 -05:00
committed by Michael Niedermayer
parent 1e506a2cc5
commit 51a84a6bca
2 changed files with 76 additions and 0 deletions

View File

@@ -3587,6 +3587,24 @@ int av_packet_merge_side_data(AVPacket *pkt);
int av_packet_split_side_data(AVPacket *pkt);
/**
* Pack a dictionary for use in side_data.
*
* @param dict The dictionary to pack.
* @param size pointer to store the size of the returned data
* @return pointer to data if successful, NULL otherwise
*/
uint8_t *av_packet_pack_dictionary(AVDictionary *dict, int *size);
/**
* Unpack a dictionary from side_data.
*
* @param data data from side_data
* @param size size of the data
* @param dict the metadata storage dictionary
* @return 0 on success, < 0 on failure
*/
int av_packet_unpack_dictionary(const uint8_t *data, int size, AVDictionary **dict);
/**
* Convenience function to free all the side data stored.