diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-02-03 22:58:29 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-02-03 22:58:29 +0000 |
commit | 6fa5a56c1ba7ee770e48ddc8f785d85c00ba9c4d (patch) | |
tree | c60e1a61c337ae83557526b1bbe229a52219479a /libavformat/avformat.h | |
parent | cdc90af00835297b8d5f3f06c47cf2c53267c3a3 (diff) | |
download | ffmpeg-streaming-6fa5a56c1ba7ee770e48ddc8f785d85c00ba9c4d.zip ffmpeg-streaming-6fa5a56c1ba7ee770e48ddc8f785d85c00ba9c4d.tar.gz |
zero copy packet handling for DV1394 by Max Krasnyansky
Originally committed as revision 1542 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index a6c2f25..c27b81d 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 */ |