Mercurial > libavformat.hg
diff avformat.h @ 53:fb671d87824e libavformat
zero copy packet handling for DV1394 by Max Krasnyansky
| author | bellard |
|---|---|
| date | Mon, 03 Feb 2003 22:58:29 +0000 |
| parents | 2a60f406fccc |
| children | b0e0eb595e29 |
line wrap: on
line diff
--- a/avformat.h Mon Feb 03 22:53:10 2003 +0000 +++ b/avformat.h Mon Feb 03 22:58:29 2003 +0000 @@ -20,15 +20,33 @@ 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; + int size; + int stream_index; + int flags; + int duration; + void (*destruct)(struct AVPacket *); + void *priv; +} AVPacket; #define PKT_FLAG_KEY 0x0001 -} AVPacket; + +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 */
