#ifndef AVFORMAT_H
#define AVFORMAT_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LIBAVFORMAT_VERSION_INT ((51<<16)+(10<<8)+0)
-#define LIBAVFORMAT_VERSION 51.10.0
+#define LIBAVFORMAT_VERSION_INT ((51<<16)+(12<<8)+1)
+#define LIBAVFORMAT_VERSION 51.12.1
#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
/*************************************************/
/* fractional numbers for exact pts handling */
-/* the exact value of the fractional number is: 'val + num / den'. num
- is assumed to be such as 0 <= num < den */
+/**
+ * the exact value of the fractional number is: 'val + num / den'.
+ * num is assumed to be such as 0 <= num < den
+ * @deprecated Use AVRational instead
+*/
typedef struct AVFrac {
int64_t val, num, den;
} AVFrac attribute_deprecated;
} AVProbeData;
#define AVPROBE_SCORE_MAX 100 ///< max score, half of that is used for file extension based detection
+#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer
typedef struct AVFormatParameters {
AVRational time_base;
const char *name;
const char *long_name;
const char *mime_type;
- const char *extensions; /**< comma separated extensions */
+ const char *extensions; /**< comma separated filename extensions */
/** size of private data so that it can be allocated in the wrapper */
int priv_data_size;
/* output support */
int (*read_probe)(AVProbeData *);
/** read the format header and initialize the AVFormatContext
structure. Return 0 if OK. 'ap' if non NULL contains
- additionnal paramters. Only used in raw format right
+ additional paramters. Only used in raw format right
now. 'av_new_stream' should be called to create new streams. */
int (*read_header)(struct AVFormatContext *,
AVFormatParameters *ap);
struct AVInputFormat *next;
} AVInputFormat;
+enum AVStreamParseType {
+ AVSTREAM_PARSE_NONE,
+ AVSTREAM_PARSE_FULL, /**< full parsing and repack */
+ AVSTREAM_PARSE_HEADERS, /**< only parse headers, don't repack */
+ AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on packet boundary */
+};
+
typedef struct AVIndexEntry {
int64_t pos;
int64_t timestamp;
*/
AVRational r_frame_rate;
void *priv_data;
+#if LIBAVFORMAT_VERSION_INT < (52<<16)
/* internal data used in av_find_stream_info() */
int64_t codec_info_duration;
int codec_info_nb_frames;
+#endif
/** encoding: PTS generation when outputing stream */
AVFrac pts;
/** quality, as it has been removed from AVCodecContext and put in AVVideoFrame
* MN:dunno if thats the right place, for it */
float quality;
- /** decoding: position of the first frame of the component, in
- AV_TIME_BASE fractional seconds. */
+ /** decoding: pts of the first frame of the stream, in stream time base. */
int64_t start_time;
- /** decoding: duration of the stream, in AV_TIME_BASE fractional
- seconds. */
+ /** decoding: duration of the stream, in stream time base. */
int64_t duration;
char language[4]; /** ISO 639 3-letter language code (empty string if undefined) */
/* av_read_frame() support */
- int need_parsing; ///< 1->full parsing needed, 2->only parse headers dont repack
+ enum AVStreamParseType need_parsing;
struct AVCodecParserContext *parser;
int64_t cur_dts;
const char *filename, const char *mime_type, enum CodecType type);
/**
- * Print nice hexa dump of a buffer
- * @param f stream for output
+ * Send a nice hexadecimal dump of a buffer to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
* @param buf buffer
* @param size buffer size
+ *
+ * @see av_hex_dump_log, av_pkt_dump, av_pkt_dump_log
*/
void av_hex_dump(FILE *f, uint8_t *buf, int size);
/**
- * Print on 'f' a nice dump of a packet
- * @param f stream for output
+ * Send a nice hexadecimal dump of a buffer to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump, av_pkt_dump, av_pkt_dump_log
+ */
+void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size);
+
+/**
+ * Send a nice dump of a packet to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
* @param pkt packet to dump
* @param dump_payload true if the payload must be displayed too
*/
void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload);
+/**
+ * Send a nice dump of a packet to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param pkt packet to dump
+ * @param dump_payload true if the payload must be displayed too
+ */
+void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload);
+
void av_register_all(void);
/** codec tag <-> codec id */
* @param filename filename to open.
* @param fmt if non NULL, force the file format to use
* @param buf_size optional buffer size (zero if default is OK)
- * @param ap additionnal parameters needed when opening the file (NULL if default)
+ * @param ap additional parameters needed when opening the file (NULL if default)
* @return 0 if OK. AVERROR_xxx otherwise.
*/
int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
#endif /* HAVE_AV_CONFIG_H */
-#ifdef __cplusplus
-}
-#endif
-
#endif /* AVFORMAT_H */