History

avfilter/avfilter: Move AVFilterGraph private fields to FFFilterGraph

(These fields were in AVFilterGraph although AVFilterGraphInternal existed for years.)

Andreas Rheinhardt committed 2 years ago

Commit 89eea4e1 parent 03567ed3 files · +23 −27Browse files

Showing the changes to libavfilter/avfiltergraph.c (1 of 3 files). Show all

Unified · Split

libavfilter/avfiltergraph.c+17−15
@@ -126,7 +126,7 @@ void avfilter_graph_free(AVFilterGraph **graphp) · 125 unmodified lines
126126
127127 ff_graph_thread_free(graphi);
128128
129− av_freep(&graph->sink_links);
129+ av_freep(&graphi->sink_links);
130130
131131 av_opt_free(graph);
132132
@@ -158,7 +158,7 @@ fail: · 25 unmodified lines
158158
159159 void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags)
160160 {
161− graph->disable_auto_convert = flags;
161+ fffiltergraph(graph)->disable_auto_convert = flags;
162162 }
163163
164164 AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
@@ -470,7 +470,7 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx) · 305 unmodified lines
470470 char inst_name[30];
471471 const char *opts;
472472
473− if (graph->disable_auto_convert) {
473+ if (fffiltergraph(graph)->disable_auto_convert) {
474474 av_log(log_ctx, AV_LOG_ERROR,
475475 "The filters '%s' and '%s' do not have a common format "
476476 "and automatic conversion is disabled.\n",
@@ -1316,8 +1316,8 @@ static int graph_config_pointers(AVFilterGraph *graph, void *log_ctx) · 839 unmodified lines
13161316 }
13171317 }
13181318 av_assert0(n == sink_links_count);
1319− graph->sink_links = sinks;
1320− graph->sink_links_count = sink_links_count;
1319+ fffiltergraph(graph)->sink_links = sinks;
1320+ fffiltergraph(graph)->sink_links_count = sink_links_count;
13211321 return 0;
13221322 }
13231323
@@ -1400,7 +1400,7 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const · 76 unmodified lines
14001400 return 0;
14011401 }
14021402
1403−static void heap_bubble_up(AVFilterGraph *graph,
1403+static void heap_bubble_up(FFFilterGraph *graph,
14041404 AVFilterLink *link, int index)
14051405 {
14061406 AVFilterLink **links = graph->sink_links;
@@ -1419,7 +1419,7 @@ static void heap_bubble_up(AVFilterGraph *graph, · 12 unmodified lines
14191419 link->age_index = index;
14201420 }
14211421
1422−static void heap_bubble_down(AVFilterGraph *graph,
1422+static void heap_bubble_down(FFFilterGraph *graph,
14231423 AVFilterLink *link, int index)
14241424 {
14251425 AVFilterLink **links = graph->sink_links;
@@ -1445,18 +1445,20 @@ static void heap_bubble_down(AVFilterGraph *graph, · 19 unmodified lines
14451445
14461446 void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link)
14471447 {
1448− heap_bubble_up (graph, link, link->age_index);
1449− heap_bubble_down(graph, link, link->age_index);
1448+ FFFilterGraph *graphi = fffiltergraph(graph);
1449+ heap_bubble_up (graphi, link, link->age_index);
1450+ heap_bubble_down(graphi, link, link->age_index);
14501451 }
14511452
14521453 int avfilter_graph_request_oldest(AVFilterGraph *graph)
14531454 {
1454− AVFilterLink *oldest = graph->sink_links[0];
1455+ FFFilterGraph *graphi = fffiltergraph(graph);
1456+ AVFilterLink *oldest = graphi->sink_links[0];
14551457 int64_t frame_count;
14561458 int r;
14571459
1458− while (graph->sink_links_count) {
1459− oldest = graph->sink_links[0];
1460+ while (graphi->sink_links_count) {
1461+ oldest = graphi->sink_links[0];
14601462 if (oldest->dst->filter->activate) {
14611463 r = av_buffersink_get_frame_flags(oldest->dst, NULL,
14621464 AV_BUFFERSINK_FLAG_PEEK);
@@ -1471,12 +1473,12 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) · 8 unmodified lines
14711473 oldest->dst->name,
14721474 oldest->dstpad->name);
14731475 /* EOF: remove the link from the heap */
1474− if (oldest->age_index < --graph->sink_links_count)
1475− heap_bubble_down(graph, graph->sink_links[graph->sink_links_count],
1476+ if (oldest->age_index < --graphi->sink_links_count)
1477+ heap_bubble_down(graphi, graphi->sink_links[graphi->sink_links_count],
14761478 oldest->age_index);
14771479 oldest->age_index = -1;
14781480 }
1479− if (!graph->sink_links_count)
1481+ if (!graphi->sink_links_count)
14801482 return AVERROR_EOF;
14811483 av_assert1(!oldest->dst->filter->activate);
14821484 av_assert1(oldest->age_index >= 0);

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