History

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

Vitor Sessak committed 18 years ago

Commit f60208f1 parent 6ae82d11 file · +27 −0Browse files

Unified · Split

libavfilter/avfilter.c+27−0
@@ -31,6 +31,33 @@ · 30 unmodified lines
31static int filter_count = 0;31static int filter_count = 0;
32static AVFilter **filters = NULL;32static AVFilter **filters = NULL;
33 33
34struct AVFilterGraph {
35 unsigned filter_count;
36 AVFilterContext **filters;
37};
38
39AVFilterGraph *avfilter_create_graph(void)
40{
41 return av_mallocz(sizeof(AVFilterGraph));
42}
43
44void 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
54void 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/* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */61/* TODO: buffer pool. see comment for avfilter_default_get_video_buffer() */
35void avfilter_default_free_video_buffer(AVFilterPic *pic)62void avfilter_default_free_video_buffer(AVFilterPic *pic)
36{63{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t