const char *long_name;
const char *mime_type;
const char *extensions; /**< comma-separated filename extensions */
+ /* output support */
+ enum CodecID audio_codec; /**< default audio codec */
+ enum CodecID video_codec; /**< default video codec */
+ enum CodecID subtitle_codec; /**< default subtitle codec */
+ /**
+ * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
+ * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
+ * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH
+ */
+ int flags;
+
+ /**
+ * List of supported codec_id-codec_tag pairs, ordered by "better
+ * choice first". The arrays are all terminated by CODEC_ID_NONE.
+ */
+ const struct AVCodecTag * const *codec_tag;
+
+
+ const AVClass *priv_class; ///< AVClass for the private context
+
+ /*****************************************************************
+ * No fields below this line are part of the public API. They
+ * may not be used outside of libavformat and can be changed and
+ * removed at will.
+ * New public fields should be added right above.
+ *****************************************************************
+ */
+ struct AVOutputFormat *next;
/**
* size of private data so that it can be allocated in the wrapper
*/
int priv_data_size;
- /* output support */
- enum CodecID audio_codec; /**< default audio codec */
- enum CodecID video_codec; /**< default video codec */
+
int (*write_header)(struct AVFormatContext *);
/**
* Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
*/
int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
int (*write_trailer)(struct AVFormatContext *);
- /**
- * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
- * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
- * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH
- */
- int flags;
/**
* Currently only used to set pixel format if not YUV420P.
*/
int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
AVPacket *in, int flush);
-
- /**
- * List of supported codec_id-codec_tag pairs, ordered by "better
- * choice first". The arrays are all terminated by CODEC_ID_NONE.
- */
- const struct AVCodecTag * const *codec_tag;
-
- enum CodecID subtitle_codec; /**< default subtitle codec */
-
- const AVClass *priv_class; ///< AVClass for the private context
-
/**
* Test if the given codec can be stored in this container.
*
* A negative number if unknown.
*/
int (*query_codec)(enum CodecID id, int std_compliance);
-
- /* private fields */
- struct AVOutputFormat *next;
} AVOutputFormat;
/**
* @}
*/
const char *long_name;
+ /**
+ * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+ * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+ * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
+ */
+ int flags;
+
+ /**
+ * If extensions are defined, then no probe is done. You should
+ * usually not use extension format guessing because it is not
+ * reliable enough
+ */
+ const char *extensions;
+
+ const struct AVCodecTag * const *codec_tag;
+
+ const AVClass *priv_class; ///< AVClass for the private context
+
+ /*****************************************************************
+ * No fields below this line are part of the public API. They
+ * may not be used outside of libavformat and can be changed and
+ * removed at will.
+ * New public fields should be added right above.
+ *****************************************************************
+ */
+ struct AVInputFormat *next;
+
+ /**
+ * Raw demuxers store their codec ID here.
+ */
+ int raw_codec_id;
+
/**
* Size of private data so that it can be allocated in the wrapper.
*/
/**
* Read the format header and initialize the AVFormatContext
- * structure. Return 0 if OK. 'ap' if non-NULL contains
- * additional parameters. Only used in raw format right
- * now. 'av_new_stream' should be called to create new streams.
+ * structure. Return 0 if OK. Only used in raw format right
+ * now. 'avformat_new_stream' should be called to create new streams.
*/
int (*read_header)(struct AVFormatContext *);
/**
* Read one packet and put it in 'pkt'. pts and flags are also
- * set. 'av_new_stream' can be called only if the flag
+ * set. 'avformat_new_stream' can be called only if the flag
* AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
* background thread).
* @return 0 on success, < 0 on error.
int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
int64_t *pos, int64_t pos_limit);
- /**
- * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
- * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
- * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
- */
- int flags;
-
- /**
- * If extensions are defined, then no probe is done. You should
- * usually not use extension format guessing because it is not
- * reliable enough
- */
- const char *extensions;
-
- /**
- * General purpose read-only value that the format can use.
- */
- int value;
-
/**
* Start/resume playing - only meaningful if using a network-based format
* (RTSP).
*/
int (*read_pause)(struct AVFormatContext *);
- const struct AVCodecTag * const *codec_tag;
-
/**
* Seek to timestamp ts.
* Seeking will be done so that the point from which all active streams
* Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
*/
int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
- const AVClass *priv_class; ///< AVClass for the private context
-
- /* private fields */
- struct AVInputFormat *next;
} AVInputFormat;
/**
* @}
#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.
AVRational r_frame_rate;
void *priv_data;
-#if FF_API_REORDER_PRIVATE
- /* internal data used in av_find_stream_info() */
- int64_t first_dts;
-#endif
-
/**
* encoding: pts generation when outputting stream
*/
* encoding: set by libavformat in av_write_header
*/
AVRational time_base;
-#if FF_API_REORDER_PRIVATE
- int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-#endif
-#if FF_API_STREAM_COPY
- /* ffmpeg.c private use */
- attribute_deprecated int stream_copy; /**< If set, just copy stream. */
-#endif
- 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 stream time base.
*/
int64_t duration;
-#if FF_API_REORDER_PRIVATE
- /* av_read_frame() support */
- enum AVStreamParseType need_parsing;
- struct AVCodecParserContext *parser;
-
- int64_t cur_dts;
- int last_IP_duration;
- int64_t last_IP_pts;
- /* av_seek_frame() support */
- AVIndexEntry *index_entries; /**< Only used if the format does not
- support seeking natively. */
- int nb_index_entries;
- unsigned int index_entries_allocated_size;
-#endif
-
int64_t nb_frames; ///< number of frames in this stream if known or 0
int disposition; /**< AV_DISPOSITION_* bit field */
-#if FF_API_REORDER_PRIVATE
- AVProbeData probe_data;
-#define MAX_REORDER_DELAY 16
- int64_t pts_buffer[MAX_REORDER_DELAY+1];
-#endif
+ enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
/**
* sample aspect ratio (0 if unknown)
AVDictionary *metadata;
-#if FF_API_REORDER_PRIVATE
- /* Intended mostly for av_read_frame() support. Not supposed to be used by */
- /* external applications; try to use something else if at all possible. */
- const uint8_t *cur_ptr;
- int cur_len;
- AVPacket cur_pkt;
-
- // Timestamp generation support:
/**
- * Timestamp corresponding to the last dts sync point.
- *
- * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
- * a DTS is received from the underlying container. Otherwise set to
- * AV_NOPTS_VALUE by default.
- */
- int64_t reference_dts;
-
- /**
- * Number of packets to buffer for codec probing
- * NOT PART OF PUBLIC API
- */
-#define MAX_PROBE_PACKETS 2500
- int probe_packets;
-
- /**
- * last packet in packet_buffer for this stream when muxing.
- * Used internally, NOT PART OF PUBLIC API, do not read or
- * write from outside of libav*
+ * Average framerate
*/
- struct AVPacketList *last_in_packet_buffer;
-#endif
+ AVRational avg_frame_rate;
/**
- * Average framerate
+ * 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
*/
- AVRational avg_frame_rate;
+ AVPacket attached_pic;
/*****************************************************************
* All fields below this line are not part of the public API. They
*****************************************************************
*/
- /**
- * Number of frames that have been demuxed during av_find_stream_info()
- */
- int codec_info_nb_frames;
-
/**
* Stream information used internally by av_find_stream_info()
*/
int64_t codec_info_duration;
int nb_decoded_frames;
} *info;
-#if !FF_API_REORDER_PRIVATE
+
+ AVPacket cur_pkt;
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:
/**
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
#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;
+
+ /* av_read_frame() support */
+ enum AVStreamParseType need_parsing;
+ struct AVCodecParserContext *parser;
+
/**
* last packet in packet_buffer for this stream when muxing.
*/
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) */
-#endif
} AVStream;
#define AV_PROGRAM_RUNNING 1
*/
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().
AVStream **streams;
char filename[1024]; /**< input or output filename */
- /* stream info */
- int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
-#if FF_API_REORDER_PRIVATE
- /* private data for pts handling (do not modify directly). */
- /**
- * 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;
-#endif
/**
* Decoding: position of the first frame of the component, in
*/
int bit_rate;
-#if FF_API_REORDER_PRIVATE
- /* av_read_frame() support */
- AVStream *cur_st;
-
- /* av_seek_frame() support */
- int64_t data_offset; /**< offset of the first packet */
-#endif
-
unsigned int packet_size;
int max_delay;
unsigned int nb_chapters;
AVChapter **chapters;
- /**
- * Flags to enable debugging.
- */
- int debug;
-#define FF_FDEBUG_TS 0x0001
-
-#if FF_API_REORDER_PRIVATE
- /**
- * Raw packets from the demuxer, prior to parsing and decoding.
- * This buffer is used for buffering packets until the codec can
- * be identified, as parsing cannot be done without knowing the
- * codec.
- */
- struct AVPacketList *raw_packet_buffer;
- struct AVPacketList *raw_packet_buffer_end;
-
- struct AVPacketList *packet_buffer_end;
-#endif
-
AVDictionary *metadata;
-#if FF_API_REORDER_PRIVATE
- /**
- * Remaining size available for raw_packet_buffer, in bytes.
- * NOT PART OF PUBLIC API
- */
-#define RAW_PACKET_BUFFER_SIZE 2500000
- int raw_packet_buffer_remaining_size;
-#endif
-
/**
* Start time of the stream in real world time, in microseconds
* since the unix epoch (00:00 1st January 1970). That is, pts=0
*/
AVIOInterruptCB interrupt_callback;
+ /**
+ * Flags to enable debugging.
+ */
+ int debug;
+#define FF_FDEBUG_TS 0x0001
/*****************************************************************
* 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
* New public fields should be added right above.
*****************************************************************
*/
-#if !FF_API_REORDER_PRIVATE
- /**
- * Raw packets from the demuxer, prior to parsing and decoding.
- * This buffer is used for buffering packets until the codec can
- * be identified, as parsing cannot be done without knowing the
- * codec.
- */
- struct AVPacketList *raw_packet_buffer;
- struct AVPacketList *raw_packet_buffer_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
/* av_seek_frame() support */
int64_t data_offset; /**< offset of the first packet */
-#endif
+
+ /**
+ * Raw packets from the demuxer, prior to parsing and decoding.
+ * This buffer is used for buffering packets until the codec can
+ * be identified, as parsing cannot be done without knowing the
+ * codec.
+ */
+ struct AVPacketList *raw_packet_buffer;
+ struct AVPacketList *raw_packet_buffer_end;
+ /**
+ * Remaining size available for raw_packet_buffer, in bytes.
+ */
+#define RAW_PACKET_BUFFER_SIZE 2500000
+ int raw_packet_buffer_remaining_size;
} AVFormatContext;
typedef struct AVPacketList {
* @}
*/
-#if FF_API_SET_PTS_INFO
-/**
- * @deprecated this function is not supposed to be called outside of lavf
- */
-attribute_deprecated
-void av_set_pts_info(AVStream *s, int pts_wrap_bits,
- unsigned int pts_num, unsigned int pts_den);
-#endif
-
#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
#define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes
#define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes
#define AVSEEK_FLAG_FRAME 8 ///< seeking based on frame number
-#if FF_API_SEEK_PUBLIC
-attribute_deprecated
-int av_seek_frame_binary(AVFormatContext *s, int stream_index,
- int64_t target_ts, int flags);
-attribute_deprecated
-void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp);
-attribute_deprecated
-int64_t av_gen_search(AVFormatContext *s, int stream_index,
- int64_t target_ts, int64_t pos_min,
- int64_t pos_max, int64_t pos_limit,
- int64_t ts_min, int64_t ts_max,
- int flags, int64_t *ts_ret,
- int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
-#endif
-
/**
* @addtogroup lavf_encoding
* @{
*/
int avformat_query_codec(AVOutputFormat *ofmt, enum CodecID codec_id, int std_compliance);
+/**
+ * @defgroup riff_fourcc RIFF FourCCs
+ * @{
+ * Get the tables mapping RIFF FourCCs to libavcodec CodecIDs. The tables are
+ * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
+ * following code:
+ * @code
+ * uint32_t tag = MKTAG('H', '2', '6', '4');
+ * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
+ * enum CodecID id = av_codec_get_id(table, tag);
+ * @endcode
+ */
+/**
+ * @return the table mapping RIFF FourCCs for video to libavcodec CodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_video_tags(void);
+/**
+ * @return the table mapping RIFF FourCCs for audio to CodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_audio_tags(void);
+/**
+ * @}
+ */
+
/**
* @}
*/