]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avformat.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavformat / avformat.h
index 19441f8e21b5e740e47f94e88375600cd00d691f..143c48e17dc00c05a8faf43d7dad832d53b7b0bc 100644 (file)
 #include "avio.h"
 #include "libavformat/version.h"
 
+#if FF_API_AV_GETTIME
+#include "libavutil/time.h"
+#endif
+
 struct AVFormatContext;
 
 
@@ -726,7 +730,7 @@ typedef struct AVStream {
     /**
      * 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;
@@ -1099,8 +1103,25 @@ typedef struct AVFormatContext {
     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;
@@ -1837,11 +1858,6 @@ void av_dump_format(AVFormatContext *ic,
                     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.
  *