1

While I examine the source code of ffmpeg, I see this line:

enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method
(const AVFormatContext* ctx);

What is the functionality of enum here?

6 Answers 6

8

av_fmt_ctx_get_duration_estimation_method is a function which returns an object of enum type AVDurationEstimationMethod .

Sign up to request clarification or add additional context in comments.

1 Comment

Te be a bit pedantic, it returns an object of type enum AVDurationEstimationMethod
5

enum AVDurationEstimationMethod together is a type which the function av_fmt_ctx_get_duration_estimation_method returns

The keyword enum, like struct and union, is necessary to represent the type. To omit it, use typedef:

typedef enum AVDurationEstimationMethod sometype;

Then you can use it like:

sometype av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx);

Comments

3

In C enums effectivly live in their own 'namespace' (this is also the case for structs). To make it clear that you're specify an enum type you must prefix it with the enum keyword.

Comments

3

The code you posted is a declaration of a function which returns an instance of enum AVDurationEstimationMethod which is an enumeration type.

Comments

1

Here the function av_fmt_ctx_get_duration_estimation_method(); is taking const AVFormatContext* ctx as argument and returning enum AVDurationEstimationMethod

Comments

0

here you can find about the method, and here about the enum return type

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.