lavfi: add AVFilterContext.graph.
authorAnton Khirnov <anton@khirnov.net>
Sun, 31 Mar 2013 10:17:07 +0000 (12:17 +0200)
committerAnton Khirnov <anton@khirnov.net>
Thu, 11 Apr 2013 18:38:23 +0000 (20:38 +0200)
It will be useful in the following commits.

doc/APIchanges
libavfilter/avfilter.h
libavfilter/avfiltergraph.c

index dd6532d2fe5041b06ffd82fb1c722f8189dc841d..9748565a08f7ad30220d1814000edbd494d608d3 100644 (file)
@@ -18,6 +18,8 @@ API changes, most recent first:
   avfilterhraph.h, user applications should include just avfilter.h
   Add avfilter_graph_alloc_filter(), deprecate avfilter_open() and
   avfilter_graph_add_filter().
+  Add AVFilterContext.graph pointing to the AVFilterGraph that contains the
+  filter.
 
 2013-xx-xx - lavfi 3.7.0 - avfilter.h
   Add AVFilter.priv_class for exporting filter options through the AVOptions API
index 94d5d6152bdce251b5a07b1157a3001b676f4f44..b37b74f2ce2ac1b251b4c10b9350614b6a99c7ac 100644 (file)
@@ -458,6 +458,8 @@ struct AVFilterContext {
     unsigned    nb_outputs;         ///< number of output pads
 
     void *priv;                     ///< private data for use by the filter
+
+    struct AVFilterGraph *graph;    ///< filtergraph this filter belongs to
 };
 
 /**
index 828b4625503532321f89c27ed97dfeba0412097f..969d9585419f8ba471458643de110f076bb1108f 100644 (file)
@@ -73,6 +73,8 @@ int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter)
     graph->filter_count = graph->nb_filters;
 #endif
 
+    filter->graph = graph;
+
     return 0;
 }
 #endif
@@ -121,6 +123,8 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
     graph->filter_count = graph->nb_filters;
 #endif
 
+    s->graph = graph;
+
     return s;
 }