diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-11 12:45:13 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-11 12:45:13 +0400 |
commit | 67a580f423f23565d885462857494d03a28cc2f1 (patch) | |
tree | 7132bc2430b9b6b4c3b156d8882df0abc96c73f0 /libavcodec/avcodec.h | |
parent | 921c1d4c95a828167342095e77bbacfad25db686 (diff) | |
parent | 5a9a9d4a2abefa63d9a898ce26715453c569e89d (diff) |
Merge commit '5a9a9d4a2abefa63d9a898ce26715453c569e89d'
* commit '5a9a9d4a2abefa63d9a898ce26715453c569e89d':
lavc: Add refcounted api to AVPacket
Conflicts:
libavcodec/avpacket.c
libavcodec/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 2b98083020..6b37b8380f 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3543,6 +3543,66 @@ int av_packet_split_side_data(AVPacket *pkt); /** + * Convenience function to free all the side data stored. + * All the other fields stay untouched. + * + * @param pkt packet + */ +void av_packet_free_side_data(AVPacket *pkt); + +/** + * Setup a new reference to the data described by a given packet + * + * If src is reference-counted, setup dst as a new reference to the + * buffer in src. Otherwise allocate a new buffer in dst and copy the + * data from src into it. + * + * All the other fields are copied from src. + * + * @see av_packet_unref + * + * @param dst Destination packet + * @param src Source packet + * + * @return 0 on success, a negative AVERROR on error. + */ +int av_packet_ref(AVPacket *dst, AVPacket *src); + +/** + * Wipe the packet. + * + * Unreference the buffer referenced by the packet and reset the + * remaining packet fields to their default values. + * + * @param pkt The packet to be unreferenced. + */ +void av_packet_unref(AVPacket *pkt); + +/** + * Move every field in src to dst and reset src. + * + * @see av_packet_unref + * + * @param src Source packet, will be reset + * @param dst Destination packet + */ +void av_packet_move_ref(AVPacket *dst, AVPacket *src); + +/** + * Copy only "properties" fields from src to dst. + * + * Properties for the purpose of this function are all the fields + * beside those related to the packet data (buf, data, size) + * + * @param dst Destination packet + * @param src Source packet + * + * @return 0 on success AVERROR on failure. + * + */ +int av_packet_copy_props(AVPacket *dst, const AVPacket *src); + +/** * @} */ |