Revision f60208f4

View differences:

libavfilter/avfilter.c
31 31
static int filter_count = 0;
32 32
static AVFilter **filters = NULL;
33 33

  
34
struct AVFilterGraph {
35
    unsigned filter_count;
36
    AVFilterContext **filters;
37
};
38

  
39
AVFilterGraph *avfilter_create_graph(void)
40
{
41
    return av_mallocz(sizeof(AVFilterGraph));
42
}
43

  
44
void avfilter_destroy_graph(AVFilterGraph *graph)
45
{
46
    unsigned i;
47

  
48
    for(i = 0; i < graph->filter_count; i ++)
49
        avfilter_destroy(graph->filters[i]);
50
    av_free(graph->filters);
51
    av_free(graph);
52
}
53

  
54
void avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
55
{
56
    graph->filters = av_realloc(graph->filters,
57
                                sizeof(AVFilterContext*) * ++graph->filter_count);
58
    graph->filters[graph->filter_count - 1] = filter;
59
}
60

  
34 61
/* TODO: buffer pool.  see comment for avfilter_default_get_video_buffer() */
35 62
void avfilter_default_free_video_buffer(AVFilterPic *pic)
36 63
{

Also available in: Unified diff