1

当我检查 ffmpeg 的源代码时,我看到了这一行:

enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method
(const AVFormatContext* ctx);

这里的功能是enum什么?

4

6 回答 6

8

av_fmt_ctx_get_duration_estimation_method是一个返回枚举类型对象的函数AVDurationEstimationMethod

于 2013-07-17T12:03:30.763 回答
5

enum AVDurationEstimationMethodtogether 是函数av_fmt_ctx_get_duration_estimation_method返回的类型

关键字enum和是表示类型所必需的structunion要省略它,请使用typedef

typedef enum AVDurationEstimationMethod sometype;

然后你可以像这样使用它:

sometype av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx);
于 2013-07-17T12:06:13.547 回答
3

您发布的代码是一个函数的声明,它返回enum AVDurationEstimationMethod一个枚举类型的实例。

于 2013-07-17T12:04:37.080 回答
3

在 C 中,枚举有效地存在于它们自己的“命名空间”中(结构也是如此)。为了清楚地表明您指定了枚举类型,您必须在其前面加上enum关键字。

于 2013-07-17T12:08:04.680 回答
1

这里函数av_fmt_ctx_get_duration_estimation_method();作为const AVFormatContext* ctx参数并返回enum AVDurationEstimationMethod

于 2013-07-17T12:05:38.197 回答
0

在这里您可以找到有关该方法的信息,在这里您可以找到有关枚举返回类型的信息

于 2013-07-17T12:06:14.387 回答