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
126 126
127 ff_graph_thread_free(graphi);127 ff_graph_thread_free(graphi);
128 128
129 av_freep(&graph->sink_links);129 av_freep(&graphi->sink_links);
130 130
131 av_opt_free(graph);131 av_opt_free(graph);
132 132
@@ -158,7 +158,7 @@ fail: · 25 unmodified lines
158 158
159void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags)159void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags)
160{160{
161 graph->disable_auto_convert = flags;161 fffiltergraph(graph)->disable_auto_convert = flags;
162}162}
163 163
164AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,164AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph,
@@ -470,7 +470,7 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx) · 305 unmodified lines
470 char inst_name[30];470 char inst_name[30];
471 const char *opts;471 const char *opts;
472 472
473 if (graph->disable_auto_convert) {473 if (fffiltergraph(graph)->disable_auto_convert) {
474 av_log(log_ctx, AV_LOG_ERROR,474 av_log(log_ctx, AV_LOG_ERROR,
475 "The filters '%s' and '%s' do not have a common format "475 "The filters '%s' and '%s' do not have a common format "
476 "and automatic conversion is disabled.\n",476 "and automatic conversion is disabled.\n",
@@ -1316,8 +1316,8 @@ static int graph_config_pointers(AVFilterGraph *graph, void *log_ctx) · 839 unmodified lines
1316 }1316 }
1317 }1317 }
1318 av_assert0(n == sink_links_count);1318 av_assert0(n == sink_links_count);
1319 graph->sink_links = sinks;1319 fffiltergraph(graph)->sink_links = sinks;
1320 graph->sink_links_count = sink_links_count;1320 fffiltergraph(graph)->sink_links_count = sink_links_count;
1321 return 0;1321 return 0;
1322}1322}
1323 1323
@@ -1400,7 +1400,7 @@ int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const · 76 unmodified lines
1400 return 0;1400 return 0;
1401}1401}
1402 1402
1403static void heap_bubble_up(AVFilterGraph *graph,1403static void heap_bubble_up(FFFilterGraph *graph,
1404 AVFilterLink *link, int index)1404 AVFilterLink *link, int index)
1405{1405{
1406 AVFilterLink **links = graph->sink_links;1406 AVFilterLink **links = graph->sink_links;
@@ -1419,7 +1419,7 @@ static void heap_bubble_up(AVFilterGraph *graph, · 12 unmodified lines
1419 link->age_index = index;1419 link->age_index = index;
1420}1420}
1421 1421
1422static void heap_bubble_down(AVFilterGraph *graph,1422static void heap_bubble_down(FFFilterGraph *graph,
1423 AVFilterLink *link, int index)1423 AVFilterLink *link, int index)
1424{1424{
1425 AVFilterLink **links = graph->sink_links;1425 AVFilterLink **links = graph->sink_links;
@@ -1445,18 +1445,20 @@ static void heap_bubble_down(AVFilterGraph *graph, · 19 unmodified lines
1445 1445
1446void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link)1446void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link)
1447{1447{
1448 heap_bubble_up (graph, link, link->age_index);1448 FFFilterGraph *graphi = fffiltergraph(graph);
1449 heap_bubble_down(graph, link, link->age_index);1449 heap_bubble_up (graphi, link, link->age_index);
1450 heap_bubble_down(graphi, link, link->age_index);
1450}1451}
1451 1452
1452int avfilter_graph_request_oldest(AVFilterGraph *graph)1453int avfilter_graph_request_oldest(AVFilterGraph *graph)
1453{1454{
1454 AVFilterLink *oldest = graph->sink_links[0];1455 FFFilterGraph *graphi = fffiltergraph(graph);
1456 AVFilterLink *oldest = graphi->sink_links[0];
1455 int64_t frame_count;1457 int64_t frame_count;
1456 int r;1458 int r;
1457 1459
1458 while (graph->sink_links_count) {1460 while (graphi->sink_links_count) {
1459 oldest = graph->sink_links[0];1461 oldest = graphi->sink_links[0];
1460 if (oldest->dst->filter->activate) {1462 if (oldest->dst->filter->activate) {
1461 r = av_buffersink_get_frame_flags(oldest->dst, NULL,1463 r = av_buffersink_get_frame_flags(oldest->dst, NULL,
1462 AV_BUFFERSINK_FLAG_PEEK);1464 AV_BUFFERSINK_FLAG_PEEK);
@@ -1471,12 +1473,12 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) · 8 unmodified lines
1471 oldest->dst->name,1473 oldest->dst->name,
1472 oldest->dstpad->name);1474 oldest->dstpad->name);
1473 /* EOF: remove the link from the heap */1475 /* EOF: remove the link from the heap */
1474 if (oldest->age_index < --graph->sink_links_count)1476 if (oldest->age_index < --graphi->sink_links_count)
1475 heap_bubble_down(graph, graph->sink_links[graph->sink_links_count],1477 heap_bubble_down(graphi, graphi->sink_links[graphi->sink_links_count],
1476 oldest->age_index);1478 oldest->age_index);
1477 oldest->age_index = -1;1479 oldest->age_index = -1;
1478 }1480 }
1479 if (!graph->sink_links_count)1481 if (!graphi->sink_links_count)
1480 return AVERROR_EOF;1482 return AVERROR_EOF;
1481 av_assert1(!oldest->dst->filter->activate);1483 av_assert1(!oldest->dst->filter->activate);
1482 av_assert1(oldest->age_index >= 0);1484 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