History

avfilter: add a pointer from links to graph.

Nicolas George committed 14 years ago

Commit e0761fe1 parent 78ac49c2 files · +22 −0Browse files

Unified · Split

2 files
  1. libavfilter/avfilter.h +6 −0
  2. libavfilter/avfiltergraph.c +16 −0
libavfilter/avfilter.h+6−0
@@ -690,6 +690,12 @@ struct AVFilterLink { · 689 unmodified lines
690690 AVRational time_base;
691691
692692 struct AVFilterPool *pool;
693+
694+ /**
695+ * Graph the filter belongs to.
696+ */
697+ struct AVFilterGraph *graph;
698+
693699 };
694700
695701 /**
libavfilter/avfiltergraph.c+16−0
@@ -374,6 +374,21 @@ int ff_avfilter_graph_config_formats(AVFilterGraph *graph, AVClass *log_ctx) · 373 unmodified lines
374374 return 0;
375375 }
376376
377+static void ff_avfilter_graph_config_pointers(AVFilterGraph *graph,
378+ AVClass *log_ctx)
379+{
380+ unsigned i, j;;
381+ AVFilterContext *f;
382+
383+ for (i = 0; i < graph->filter_count; i++) {
384+ f = graph->filters[i];
385+ for (j = 0; j < f->input_count; j++)
386+ f->inputs[j]->graph = graph;
387+ for (j = 0; j < f->output_count; j++)
388+ f->outputs[j]->graph = graph;
389+ }
390+}
391+
377392 int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
378393 {
379394 int ret;
@@ -384,6 +399,7 @@ int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx) · 4 unmodified lines
384399 return ret;
385400 if ((ret = ff_avfilter_graph_config_links(graphctx, log_ctx)))
386401 return ret;
402+ ff_avfilter_graph_config_pointers(graphctx, log_ctx);
387403
388404 return 0;
389405 }

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