]> git.sesse.net Git - ffmpeg/commitdiff
lavc: add some AVPacket doxy.
authorAnton Khirnov <anton@khirnov.net>
Wed, 31 Oct 2012 16:27:24 +0000 (17:27 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 2 Nov 2012 06:58:38 +0000 (07:58 +0100)
libavcodec/avcodec.h

index d6a4e4d429d14610dc677ea6dc0b65c710a7c192..73321b20409856478273a63791c6f8b41bf16997 100644 (file)
@@ -872,6 +872,28 @@ enum AVPacketSideDataType {
     AV_PKT_DATA_H263_MB_INFO,
 };
 
+/**
+ * This structure stores compressed data. It is typically exported by demuxers
+ * and then passed as input to decoders, or received as output from encoders and
+ * then passed to muxers.
+ *
+ * For video, it should typically contain one compressed frame. For audio it may
+ * contain several compressed frames.
+ *
+ * AVPacket is one of the few structs in Libav, whose size is a part of public
+ * ABI. Thus it may be allocated on stack and no new fields can be added to it
+ * without libavcodec and libavformat major bump.
+ *
+ * The semantics of data ownership depends on the destruct field.
+ * If it is set, the packet data is dynamically allocated and is valid
+ * indefinitely until av_free_packet() is called (which in turn calls the
+ * destruct callback to free the data). If destruct is not set, the packet data
+ * is typically backed by some static buffer somewhere and is only valid for a
+ * limited time (e.g. until the next read call when demuxing).
+ *
+ * The side data is always allocated with av_malloc() and is freed in
+ * av_free_packet().
+ */
 typedef struct AVPacket {
     /**
      * Presentation timestamp in AVStream->time_base units; the time at which