簡體   English   中英

訪問結構變量

[英]ACCESSING STRUCTURE VARIABLES

我有一個結構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 : '.'

請讓我們知道哪一行是268!

請嘗試刪除以下逗號

.process_command = color_process_command,

然后嘗試再次編譯。 如果您可以向我們提供更多詳細信息,例如268行,則可以找到原因!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM