]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / avformat.h
index f92816f92577cd8d75283e95d8a14950dbc8e05f..6fa1216ff130594be5e25a6e3415bb54761cc7d4 100644 (file)
@@ -541,6 +541,13 @@ typedef struct AVIndexEntry {
 #define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
 #define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
 #define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
+/**
+ * The stream is stored in the file as an attached picture/"cover art" (e.g.
+ * APIC frame in ID3v2). The single packet associated with it will be returned
+ * among the first few packets read from the file unless seeking takes place.
+ * It can also be accessed at any time in AVStream.attached_pic.
+ */
+#define AV_DISPOSITION_ATTACHED_PIC      0x0400
 
 /**
  * Stream structure.
@@ -577,7 +584,6 @@ typedef struct AVStream {
      * encoding: set by libavformat in av_write_header
      */
     AVRational time_base;
-    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
 
     /**
      * Decoding: pts of the first frame of the stream in presentation order, in stream time base.
@@ -600,6 +606,8 @@ typedef struct AVStream {
 
     int disposition; /**< AV_DISPOSITION_* bit field */
 
+    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
+
     /**
      * sample aspect ratio (0 if unknown)
      * - encoding: Set by user.
@@ -614,6 +622,15 @@ typedef struct AVStream {
      */
     AVRational avg_frame_rate;
 
+    /**
+     * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
+     * will contain the attached picture.
+     *
+     * decoding: set by libavformat, must not be modified by the caller.
+     * encoding: unused
+     */
+    AVPacket attached_pic;
+
     /*****************************************************************
      * All fields below this line are not part of the public API. They
      * may not be used outside of libavformat and can be changed and
@@ -622,21 +639,6 @@ typedef struct AVStream {
      *****************************************************************
      */
 
-    /**
-     * Number of frames that have been demuxed during av_find_stream_info()
-     */
-    int codec_info_nb_frames;
-
-    /**
-     * Stream Identifier
-     * This is the MPEG-TS stream identifier +1
-     * 0 means unknown
-     */
-    int stream_identifier;
-
-    int64_t interleaver_chunk_size;
-    int64_t interleaver_chunk_duration;
-
     /**
      * Stream information used internally by av_find_stream_info()
      */
@@ -648,10 +650,10 @@ typedef struct AVStream {
         double duration_error[2][2][MAX_STD_TIMEBASES];
         int64_t codec_info_duration;
         int nb_decoded_frames;
+        int found_decoder;
     } *info;
-    const uint8_t *cur_ptr;
-    int cur_len;
-    AVPacket cur_pkt;
+
+    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
 
     // Timestamp generation support:
     /**
@@ -664,8 +666,8 @@ typedef struct AVStream {
     int64_t reference_dts;
     int64_t first_dts;
     int64_t cur_dts;
-    int last_IP_duration;
     int64_t last_IP_pts;
+    int last_IP_duration;
 
     /**
      * Number of packets to buffer for codec probing
@@ -673,6 +675,25 @@ typedef struct AVStream {
 #define MAX_PROBE_PACKETS 2500
     int probe_packets;
 
+    /**
+     * Number of frames that have been demuxed during av_find_stream_info()
+     */
+    int codec_info_nb_frames;
+
+    /**
+     * Stream Identifier
+     * This is the MPEG-TS stream identifier +1
+     * 0 means unknown
+     */
+    int stream_identifier;
+
+    int64_t interleaver_chunk_size;
+    int64_t interleaver_chunk_duration;
+
+    /* av_read_frame() support */
+    enum AVStreamParseType need_parsing;
+    struct AVCodecParserContext *parser;
+
     /**
      * last packet in packet_buffer for this stream when muxing.
      */
@@ -680,17 +701,12 @@ typedef struct AVStream {
     AVProbeData probe_data;
 #define MAX_REORDER_DELAY 16
     int64_t pts_buffer[MAX_REORDER_DELAY+1];
-    /* av_read_frame() support */
-    enum AVStreamParseType need_parsing;
-    struct AVCodecParserContext *parser;
 
     AVIndexEntry *index_entries; /**< Only used if the format does not
                                     support seeking natively. */
     int nb_index_entries;
     unsigned int index_entries_allocated_size;
 
-    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-
     /**
      * flag to indicate that probing is requested
      * NOT PART OF PUBLIC API
@@ -772,6 +788,9 @@ typedef struct AVFormatContext {
      */
     AVIOContext *pb;
 
+    /* stream info */
+    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
+
     /**
      * A list of all streams in the file. New streams are created with
      * avformat_new_stream().
@@ -785,8 +804,6 @@ typedef struct AVFormatContext {
     AVStream **streams;
 
     char filename[1024]; /**< input or output filename */
-    /* stream info */
-    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
 
     /**
      * Decoding: position of the first frame of the component, in
@@ -825,7 +842,7 @@ typedef struct AVFormatContext {
 #define AVFMT_FLAG_MP4A_LATM    0x8000 ///< Enable RTP MP4A-LATM payload
 #define AVFMT_FLAG_SORT_DTS    0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down)
 #define AVFMT_FLAG_PRIV_OPT    0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted)
-#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Dont merge side data but keep it seperate.
+#define AVFMT_FLAG_KEEP_SIDE_DATA 0x40000 ///< Dont merge side data but keep it separate.
 
     /**
      * decoding: size of data to probe; encoding: unused.
@@ -883,12 +900,6 @@ typedef struct AVFormatContext {
     unsigned int nb_chapters;
     AVChapter **chapters;
 
-    /**
-     * Flags to enable debugging.
-     */
-    int debug;
-#define FF_FDEBUG_TS        0x0001
-
     AVDictionary *metadata;
 
     /**
@@ -924,6 +935,12 @@ typedef struct AVFormatContext {
      */
     AVIOInterruptCB interrupt_callback;
 
+    /**
+     * Flags to enable debugging.
+     */
+    int debug;
+#define FF_FDEBUG_TS        0x0001
+
     /**
      * Transport stream id.
      * This will be moved into demuxer private options. Thus no API/ABI compatibility
@@ -961,6 +978,18 @@ typedef struct AVFormatContext {
      * New public fields should be added right above.
      *****************************************************************
      */
+
+    /**
+     * This buffer is only needed when packets were already buffered but
+     * not decoded, for example to get the codec parameters in MPEG
+     * streams.
+     */
+    struct AVPacketList *packet_buffer;
+    struct AVPacketList *packet_buffer_end;
+
+    /* av_seek_frame() support */
+    int64_t data_offset; /**< offset of the first packet */
+
     /**
      * Raw packets from the demuxer, prior to parsing and decoding.
      * This buffer is used for buffering packets until the codec can
@@ -969,25 +998,16 @@ typedef struct AVFormatContext {
      */
     struct AVPacketList *raw_packet_buffer;
     struct AVPacketList *raw_packet_buffer_end;
+    /**
+     * Packets split by the parser get queued here.
+     */
+    struct AVPacketList *parse_queue;
+    struct AVPacketList *parse_queue_end;
     /**
      * Remaining size available for raw_packet_buffer, in bytes.
      */
 #define RAW_PACKET_BUFFER_SIZE 2500000
     int raw_packet_buffer_remaining_size;
-
-    /**
-     * This buffer is only needed when packets were already buffered but
-     * not decoded, for example to get the codec parameters in MPEG
-     * streams.
-     */
-    struct AVPacketList *packet_buffer;
-    struct AVPacketList *packet_buffer_end;
-
-    /* av_read_frame() support */
-    AVStream *cur_st;
-
-    /* av_seek_frame() support */
-    int64_t data_offset; /**< offset of the first packet */
 } AVFormatContext;
 
 typedef struct AVPacketList {