diff options
author | James Almer <jamrial@gmail.com> | 2018-03-27 19:48:18 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2018-04-04 00:15:37 -0300 |
commit | 3a4d74c1fff8a1c2691ebf0532aa283ca9b4d0d9 (patch) | |
tree | 9de1b1245b828c03f3bf16dbc68c3698ce1c7435 /libavformat/internal.h | |
parent | 51e3010575ca55ee64ffe3c48087d263e9c1e65f (diff) | |
download | ffmpeg-3a4d74c1fff8a1c2691ebf0532aa283ca9b4d0d9.tar.gz |
avformat/utils: make AVPacketList helper functions shared
Based on a patch by Luca Barbato.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/internal.h')
-rw-r--r-- | libavformat/internal.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h index 23eb7e8a7c..c50382ad29 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -731,5 +731,44 @@ int ff_unlock_avformat(void); */ void ff_format_set_url(AVFormatContext *s, char *url); +#define FF_PACKETLIST_FLAG_REF_PACKET (1 << 0) /**< Create a new reference for the packet instead of + transferring the ownership of the existing one to the + list. */ + +/** + * Append an AVPacket to the list. + * + * @param head List head element + * @param tail List tail element + * @param pkt The packet being appended + * @param flags Any combination of FF_PACKETLIST_FLAG_* flags + * @return 0 on success, negative AVERROR value on failure. On failure, + the list is unchanged + */ +int ff_packet_list_put(AVPacketList **head, AVPacketList **tail, + AVPacket *pkt, int flags); + +/** + * Remove the oldest AVPacket in the list and return it. + * + * @note The pkt will be overwritten completely. The caller owns the + * packet and must unref it by itself. + * + * @param head List head element + * @param tail List tail element + * @param pkt Pointer to an initialized AVPacket struct + */ +int ff_packet_list_get(AVPacketList **head, AVPacketList **tail, + AVPacket *pkt); + +/** + * Wipe the list and unref all the packets in it. + * + * @param head List head element + * @param tail List tail element + */ +void ff_packet_list_free(AVPacketList **head, AVPacketList **tail); + void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]); + #endif /* AVFORMAT_INTERNAL_H */ |