diff --git a/doc/APIchanges b/doc/APIchanges index 4f7652a647..8e6b4d1a6f 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -161,6 +161,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 diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index e09fd75930..2360b24f7f 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -527,6 +527,8 @@ struct AVFilterContext { void *priv; ///< private data for use by the filter + struct AVFilterGraph *graph; ///< filtergraph this filter belongs to + struct AVFilterCommand *command_queue; }; diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 4dca8643d9..8dd543362f 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -88,6 +88,8 @@ int avfilter_graph_add_filter(AVFilterGraph *graph, AVFilterContext *filter) graph->filter_count_unused = graph->nb_filters; #endif + filter->graph = graph; + return 0; } #endif @@ -143,6 +145,8 @@ AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, graph->filter_count_unused = graph->nb_filters; #endif + s->graph = graph; + return s; }