Commit fc5999d0 authored by Michael Bradshaw's avatar Michael Bradshaw Committed by Nicolas George

lavf: add proper enum type for fmt ctx duration esitmation method

Signed-off-by: 's avatarMichael Bradshaw <mbradshaw@sorensonmedia.com>
parent 87df986d
...@@ -838,6 +838,17 @@ typedef struct AVChapter { ...@@ -838,6 +838,17 @@ typedef struct AVChapter {
AVDictionary *metadata; AVDictionary *metadata;
} AVChapter; } AVChapter;
/**
* The duration of a video can be estimated through various ways, and this enum can be used
* to know how the duration was estimated.
*/
enum AVDurationEstimationMethod {
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)
};
/** /**
* Format I/O context. * Format I/O context.
* New fields can be added to the end with minor version bumps. * New fields can be added to the end with minor version bumps.
...@@ -1108,11 +1119,7 @@ typedef struct AVFormatContext { ...@@ -1108,11 +1119,7 @@ typedef struct AVFormatContext {
* The duration field can be estimated through various ways, and this field can be used * The duration field can be estimated through various ways, and this field can be used
* to know how the duration was estimated. * to know how the duration was estimated.
*/ */
enum { enum AVDurationEstimationMethod duration_estimation_method;
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; } AVFormatContext;
/** /**
...@@ -1120,7 +1127,7 @@ typedef struct AVFormatContext { ...@@ -1120,7 +1127,7 @@ typedef struct AVFormatContext {
* *
* @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. * @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); enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx);
typedef struct AVPacketList { typedef struct AVPacketList {
AVPacket pkt; AVPacket pkt;
......
...@@ -111,7 +111,7 @@ AVFormatContext *avformat_alloc_context(void) ...@@ -111,7 +111,7 @@ AVFormatContext *avformat_alloc_context(void)
return ic; return ic;
} }
int av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx) enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx)
{ {
return ctx->duration_estimation_method; return ctx->duration_estimation_method;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment