Commit d1633ac6 authored by Vitor Sessak's avatar Vitor Sessak
Browse files

Rename avfilter_create to avfilter_open and remove the wrapper function

avfilter_create_by_name.

Commited in SoC by Bobby Bingham on 2007-08-17 23:39:55

Originally committed as revision 12703 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 66d9e9be
...@@ -430,6 +430,7 @@ int avfilter_graph_config_links(AVFilterContext *graphctx) ...@@ -430,6 +430,7 @@ int avfilter_graph_config_links(AVFilterContext *graphctx)
static AVFilterContext *create_filter_with_args(const char *filt, void *opaque) static AVFilterContext *create_filter_with_args(const char *filt, void *opaque)
{ {
AVFilter *filterdef;
AVFilterContext *ret; AVFilterContext *ret;
char *filter = av_strdup(filt); /* copy - don't mangle the input string */ char *filter = av_strdup(filt); /* copy - don't mangle the input string */
char *name, *args; char *name, *args;
...@@ -446,7 +447,8 @@ static AVFilterContext *create_filter_with_args(const char *filt, void *opaque) ...@@ -446,7 +447,8 @@ static AVFilterContext *create_filter_with_args(const char *filt, void *opaque)
av_log(NULL, AV_LOG_INFO, "creating filter \"%s\" with args \"%s\"\n", av_log(NULL, AV_LOG_INFO, "creating filter \"%s\" with args \"%s\"\n",
name, args ? args : "(none)"); name, args ? args : "(none)");
if((ret = avfilter_create_by_name(name, NULL))) { if((filterdef = avfilter_get_by_name(name)) &&
(ret = avfilter_open(filterdef, NULL))) {
if(avfilter_init_filter(ret, args, opaque)) { if(avfilter_init_filter(ret, args, opaque)) {
av_log(NULL, AV_LOG_ERROR, "error initializing filter!\n"); av_log(NULL, AV_LOG_ERROR, "error initializing filter!\n");
avfilter_destroy(ret); avfilter_destroy(ret);
...@@ -545,7 +547,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque) ...@@ -545,7 +547,7 @@ static int init(AVFilterContext *ctx, const char *args, void *opaque)
if(!args) if(!args)
return 0; return 0;
if(!(gctx->link_filter = avfilter_create(&vf_graph_dummy, NULL))) if(!(gctx->link_filter = avfilter_open(&vf_graph_dummy, NULL)))
return -1; return -1;
if(avfilter_init_filter(gctx->link_filter, NULL, ctx)) if(avfilter_init_filter(gctx->link_filter, NULL, ctx))
goto fail; goto fail;
...@@ -578,9 +580,12 @@ static int graph_load_from_desc(AVFilterContext *ctx, AVFilterGraphDesc *desc) ...@@ -578,9 +580,12 @@ static int graph_load_from_desc(AVFilterContext *ctx, AVFilterGraphDesc *desc)
AVFilterGraphDescExport *curpad; AVFilterGraphDescExport *curpad;
AVFilterContext *filt, *filtb; AVFilterContext *filt, *filtb;
AVFilter *filterdef;
/* create all filters */ /* create all filters */
for(curfilt = desc->filters; curfilt; curfilt = curfilt->next) { for(curfilt = desc->filters; curfilt; curfilt = curfilt->next) {
if(!(filt = avfilter_create_by_name(curfilt->filter, curfilt->name))) { if(!(filterdef = avfilter_get_by_name(curfilt->filter)) ||
!(filt = avfilter_open(filterdef, curfilt->name))) {
av_log(ctx, AV_LOG_ERROR, "error creating filter\n"); av_log(ctx, AV_LOG_ERROR, "error creating filter\n");
goto fail; goto fail;
} }
...@@ -639,7 +644,7 @@ static int init_desc(AVFilterContext *ctx, const char *args, void *opaque) ...@@ -639,7 +644,7 @@ static int init_desc(AVFilterContext *ctx, const char *args, void *opaque)
if(!opaque) if(!opaque)
return -1; return -1;
if(!(gctx->link_filter = avfilter_create(&vf_graph_dummy, NULL))) if(!(gctx->link_filter = avfilter_open(&vf_graph_dummy, NULL)))
return -1; return -1;
if(avfilter_init_filter(gctx->link_filter, NULL, ctx)) if(avfilter_init_filter(gctx->link_filter, NULL, ctx))
goto fail; goto fail;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment