From 6fa5a56c1ba7ee770e48ddc8f785d85c00ba9c4d Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Mon, 3 Feb 2003 22:58:29 +0000 Subject: zero copy packet handling for DV1394 by Max Krasnyansky Originally committed as revision 1542 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/avformat.h | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'libavformat/avformat.h') diff --git a/libavformat/avformat.h b/libavformat/avformat.h index a6c2f25835..c27b81df7f 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -20,15 +20,33 @@ extern "C" { typedef struct AVPacket { INT64 pts; /* presentation time stamp in stream units (set av_set_pts_info) */ UINT8 *data; - int size; - int stream_index; - int flags; - int duration; -#define PKT_FLAG_KEY 0x0001 + int size; + int stream_index; + int flags; + int duration; + void (*destruct)(struct AVPacket *); + void *priv; } AVPacket; +#define PKT_FLAG_KEY 0x0001 + +static inline void av_init_packet(AVPacket *pkt) +{ + pkt->pts = AV_NOPTS_VALUE; + pkt->flags = 0; + pkt->stream_index = 0; +} int av_new_packet(AVPacket *pkt, int size); -void av_free_packet(AVPacket *pkt); + +/** + * Free a packet + * + * @param pkt packet to free + */ +static inline void av_free_packet(AVPacket *pkt) +{ + pkt->destruct(pkt); +} /*************************************************/ /* fractional numbers for exact pts handling */ -- cgit v1.2.3