访问结构变量

时间:2013-10-24 10:37:24

标签: c++ c ffmpeg

我有一个结构AVFilter

AVFilter avfilter_vsrc_color = {  
    .name            = "color",  // error here
    .description     = NULL_IF_CONFIG_SMALL("Provide an uniformly colored input."),  
    .priv_class      = &color_class,  
    .priv_size       = sizeof(TestSourceContext),  
    .init            = color_init,  
    .uninit          = uninit,  
    .query_formats   = color_query_formats,  
    .inputs          = NULL,  
    .outputs         = color_outputs,  
    .process_command = color_process_command,  
};

和AVFilter定义为,

typedef struct AVFilter {

    const char *name;
    const char *description;
    const AVFilterPad *inputs;
    const AVFilterPad *outputs;
    const AVClass *priv_class;
    int flags;
    int (*init)(AVFilterContext *ctx);
    int (*init_dict)(AVFilterContext *ctx, AVDictionary **options);
    void (*uninit)(AVFilterContext *ctx);
    int (*query_formats)(AVFilterContext *);
    int priv_size;      ///< size of private data to allocate for the filter
    struct AVFilter *next;
    int (*process_command)(AVFilterContext *, const char *cmd, const char *arg, char *res, int res_len, int flags);
    int (*init_opaque)(AVFilterContext *ctx, void *opaque);

} AVFilter;

我得到错误,

2>c:\users\awki6\desktop\ffmpeg\libavfilter\vsrc_testsrc.cpp(268): error C2143: syntax error : missing '}' before '.'  
2>c:\users\awki6\desktop\ffmpeg\libavfilter\vsrc_testsrc.cpp(268): error C2143: syntax error : missing ';' before '.'  
2>c:\users\awki6\desktop\ffmpeg\libavfilter\vsrc_testsrc.cpp(268): error C2059: syntax error : '.'

1 个答案:

答案 0 :(得分:0)

请告诉我们哪一行是268!

请尝试删除

的逗号
.process_command = color_process_command,

然后再尝试编译它。如果你能给我们更多的细节,比如哪一行是268,那么就有可能找到原因!