|
|
|
@ -515,6 +515,26 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
int avfilter_init_dict(AVFilterContext *ctx, AVDictionary **options) |
|
|
|
|
{ |
|
|
|
|
int ret = 0; |
|
|
|
|
|
|
|
|
|
if (ctx->filter->priv_class) { |
|
|
|
|
ret = av_opt_set_dict(ctx->priv, options); |
|
|
|
|
if (ret < 0) { |
|
|
|
|
av_log(ctx, AV_LOG_ERROR, "Error applying options to the filter.\n"); |
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (ctx->filter->init) |
|
|
|
|
ret = ctx->filter->init(ctx); |
|
|
|
|
else if (ctx->filter->init_dict) |
|
|
|
|
ret = ctx->filter->init_dict(ctx, options); |
|
|
|
|
|
|
|
|
|
return ret; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int avfilter_init_str(AVFilterContext *filter, const char *args) |
|
|
|
|
{ |
|
|
|
|
AVDictionary *options = NULL; |
|
|
|
@ -616,18 +636,7 @@ int avfilter_init_str(AVFilterContext *filter, const char *args) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (filter->filter->priv_class) { |
|
|
|
|
ret = av_opt_set_dict(filter->priv, &options); |
|
|
|
|
if (ret < 0) { |
|
|
|
|
av_log(filter, AV_LOG_ERROR, "Error applying options to the filter.\n"); |
|
|
|
|
goto fail; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (filter->filter->init) |
|
|
|
|
ret = filter->filter->init(filter); |
|
|
|
|
else if (filter->filter->init_dict) |
|
|
|
|
ret = filter->filter->init_dict(filter, &options); |
|
|
|
|
ret = avfilter_init_dict(filter, &options); |
|
|
|
|
if (ret < 0) |
|
|
|
|
goto fail; |
|
|
|
|
|
|
|
|
|