summaryrefslogtreecommitdiff
path: root/libavfilter/avfilter.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-15 21:36:37 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-15 21:36:37 +0000
commitf60208f4435582306b041bbea5fa91b03cffbb83 (patch)
tree5c7070995c4a5dd53a84294beadc3cd74bb1d722 /libavfilter/avfilter.c
parent6ae82d1ec7d1a0d6a3d4e62880476bea2621b6ee (diff)
Add a simple filter graph structure and functions
Commited in SoC by Bobby Bingham on 2007-07-14 20:12:54 Originally committed as revision 11988 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfilter.c')
-rw-r--r--libavfilter/avfilter.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index dbb3e9d6a7..3d7251a8e1 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -31,6 +31,33 @@
static int filter_count = 0;
static AVFilter **filters = NULL;
+struct AVFilterGraph {
+ unsigned filter_count;
+ AVFilterContext **filters;
+};
+
+AVFilterGraph *avfilter_create_graph(void)
+{
+ return av_mallocz(sizeof(AVFilterGraph));
+}
+
+void avfilter_destroy_graph(AVFilterGraph *graph)
+{
+ unsigned i;
+
+ for(i = 0; i < graph->filter_count; i ++)
+ avfilter_destroy(graph->filters[i]);
+ av_free(graph->filters);
+ av_free(graph);
+}
+
+void avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
+{
+ graph->filters = av_realloc(graph->filters,
+ sizeof(AVFilterContext*) * ++graph->filter_count);
+ graph->filters[graph->filter_count - 1] = filter;
+}
+
/* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */
void avfilter_default_free_video_buffer(AVFilterPic *pic)
{