#include "avio.h"
#include "libavformat/version.h"
+#if FF_API_AV_GETTIME
+#include "libavutil/time.h"
+#endif
+
struct AVFormatContext;
/**
* Stream information used internally by av_find_stream_info()
*/
-#define MAX_STD_TIMEBASES (60*12+5)
+#define MAX_STD_TIMEBASES (60*12+6)
struct {
int64_t last_dts;
int64_t duration_gcd;
int raw_packet_buffer_remaining_size;
int avio_flags;
+
+ /**
+ * The duration field can be estimated through various ways, and this field can be used
+ * to know how the duration was estimated.
+ */
+ enum {
+ AVFMT_DURATION_FROM_PTS, ///< duration accurately estimated from PTSes
+ AVFMT_DURATION_FROM_STREAM, ///< duration estimated from a stream with a known duration
+ AVFMT_DURATION_FROM_BITRATE ///< duration estimated from bitrate (less accurate)
+ } duration_estimation_method;
} AVFormatContext;
+/**
+ * Returns the method used to set ctx->duration.
+ *
+ * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE.
+ */
+int av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx);
+
typedef struct AVPacketList {
AVPacket pkt;
struct AVPacketList *next;
const char *url,
int is_output);
-/**
- * Get the current time in microseconds.
- */
-int64_t av_gettime(void);
-
/**
* Return in 'buf' the path with '%d' replaced by a number.
*