summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-02-03 22:58:29 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-02-03 22:58:29 +0000
commit6fa5a56c1ba7ee770e48ddc8f785d85c00ba9c4d (patch)
treec60e1a61c337ae83557526b1bbe229a52219479a /libavformat/avformat.h
parentcdc90af00835297b8d5f3f06c47cf2c53267c3a3 (diff)
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.h30
1 files changed, 24 insertions, 6 deletions
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 */