简体   繁体   中英

ACCESSING STRUCTURE VARIABLES

I have an structure 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,  
};

and AVFilter is defined as,

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;

I m getting error like ,

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 : '.'

Please let us know which line is 268!

Please try removing the comma for

.process_command = color_process_command,

and try compiling it again. if you can give us more details like which line is 268 it will be possible to find the reason!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM