aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-15 21:36:33 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-15 21:36:33 +0000
commit6ae82d1ec7d1a0d6a3d4e62880476bea2621b6ee (patch)
tree457241618f5221960192cc30afbf8d7a40a59b45 /libavfilter/avfilter.c
parent1653c11f236a0f3eeee77984a56bfb787244a1bc (diff)
downloadffmpeg-6ae82d1ec7d1a0d6a3d4e62880476bea2621b6ee.tar.gz
Allow giving filter instances names, in anticipation of the upcoming
AVFilterGraph structure and related functions. Commited in SoC by Bobby Bingham on 2007-07-14 19:33:28 Originally committed as revision 11987 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 51fdec0fb2..dbb3e9d6a7 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -288,13 +288,14 @@ static const char *filter_name(void *p)
return filter->filter->name;
}
-AVFilterContext *avfilter_create(AVFilter *filter)
+AVFilterContext *avfilter_create(AVFilter *filter, char *inst_name)
{
AVFilterContext *ret = av_malloc(sizeof(AVFilterContext));
ret->av_class = av_mallocz(sizeof(AVClass));
ret->av_class->item_name = filter_name;
ret->filter = filter;
+ ret->name = inst_name ? strdup(inst_name) : NULL;
ret->inputs = av_mallocz(sizeof(AVFilterLink*) * pad_count(filter->inputs));
ret->outputs = av_mallocz(sizeof(AVFilterLink*) * pad_count(filter->outputs));
ret->priv = av_mallocz(filter->priv_size);
@@ -320,6 +321,7 @@ void avfilter_destroy(AVFilterContext *filter)
av_free(filter->outputs[i]);
}
+ free (filter->name);
av_free(filter->inputs);
av_free(filter->outputs);
av_free(filter->priv);
@@ -327,12 +329,12 @@ void avfilter_destroy(AVFilterContext *filter)
av_free(filter);
}
-AVFilterContext *avfilter_create_by_name(char *name)
+AVFilterContext *avfilter_create_by_name(char *name, char *inst_name)
{
AVFilter *filt;
if(!(filt = avfilter_get_by_name(name))) return NULL;
- return avfilter_create(filt);
+ return avfilter_create(filt, inst_name);
}
int avfilter_init_filter(AVFilterContext *filter, const char *args)