2013-10-24 61 views
0

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

小心告訴我們哪一行是268?也許在問題源代碼中標記它?我只是猜測它的'.name =「color」'。 – WhozCraig

回答

0

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

請嘗試

.process_command = color_process_command, 

刪除逗號,然後再試一次編譯它。如果你能給我們更多的細節,比如哪一行是268,那麼有可能找到原因!

+0

.name =「color」,// line no 268 – JAYANTHI

+0

您是否嘗試刪除此行的逗號.process_command = color_process_command,??你可以檢查類似的問題[這裏](http://stackoverflow.com/questions/330793/how-to-initialize-a-struct-in-ansi-c/330834#330834),對於最後一項沒有逗號。 –

+0

是的,我試着刪除逗號在這一行.process_command = color_process_command和我complied ..在線沒有268.name =「color」 – JAYANTHI