(These fields were in AVFilterGraph although AVFilterGraphInternal existed for years.)
Showing the changes to libavfilter (3 of 3 files). Show all
Unified · Split
| @@ -899,18 +899,6 @@ typedef struct AVFilterGraph { · 898 unmodified lines | ||
| 899 | 899 | avfilter_execute_func *execute; |
| 900 | 900 | |
| 901 | 901 | char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions |
| 902 | − | |
| 903 | − /** | |
| 904 | − * Private fields | |
| 905 | − * | |
| 906 | − * The following fields are for internal use only. | |
| 907 | − * Their type, offset, number and semantic can change without notice. | |
| 908 | − */ | |
| 909 | − | |
| 910 | − AVFilterLink **sink_links; | |
| 911 | − int sink_links_count; | |
| 912 | − | |
| 913 | − unsigned disable_auto_convert; | |
| 914 | 902 | } AVFilterGraph; |
| 915 | 903 | |
| 916 | 904 | /** |
| @@ -83,6 +83,12 @@ typedef struct FFFilterGraph { · 82 unmodified lines | ||
| 83 | 83 | * The public AVFilterGraph. See avfilter.h for it. |
| 84 | 84 | */ |
| 85 | 85 | AVFilterGraph p; |
| 86 | + | |
| 87 | + AVFilterLink **sink_links; | |
| 88 | + int sink_links_count; | |
| 89 | + | |
| 90 | + unsigned disable_auto_convert; | |
| 91 | + | |
| 86 | 92 | void *thread; |
| 87 | 93 | avfilter_execute_func *thread_execute; |
| 88 | 94 | FFFrameQueueGlobal frame_queues; |
| @@ -126,7 +126,7 @@ void avfilter_graph_free(AVFilterGraph **graphp) · 125 unmodified lines | ||
| 126 | 126 | |
| 127 | 127 | ff_graph_thread_free(graphi); |
| 128 | 128 | |
| 129 | − av_freep(&graph->sink_links); | |
| 129 | + av_freep(&graphi->sink_links); | |
| 130 | 130 | |
| 131 | 131 | av_opt_free(graph); |
| 132 | 132 | |
| @@ -158,7 +158,7 @@ fail: · 25 unmodified lines | ||
| 158 | 158 | |
| 159 | 159 | void 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 | |
| 164 | 164 | AVFilterContext *avfilter_graph_alloc_filter(AVFilterGraph *graph, |
| @@ -470,7 +470,7 @@ static int query_formats(AVFilterGraph *graph, void *log_ctx) · 305 unmodified lines | ||
| 470 | 470 | char inst_name[30]; |
| 471 | 471 | const char *opts; |
| 472 | 472 | |
| 473 | − if (graph->disable_auto_convert) { | |
| 473 | + if (fffiltergraph(graph)->disable_auto_convert) { | |
| 474 | 474 | av_log(log_ctx, AV_LOG_ERROR, |
| 475 | 475 | "The filters '%s' and '%s' do not have a common format " |
| 476 | 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 | 1318 | 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; | |
| 1321 | 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 | 1400 | return 0; |
| 1401 | 1401 | } |
| 1402 | 1402 | |
| 1403 | −static void heap_bubble_up(AVFilterGraph *graph, | |
| 1403 | +static void heap_bubble_up(FFFilterGraph *graph, | |
| 1404 | 1404 | AVFilterLink *link, int index) |
| 1405 | 1405 | { |
| 1406 | 1406 | AVFilterLink **links = graph->sink_links; |
| @@ -1419,7 +1419,7 @@ static void heap_bubble_up(AVFilterGraph *graph, · 12 unmodified lines | ||
| 1419 | 1419 | link->age_index = index; |
| 1420 | 1420 | } |
| 1421 | 1421 | |
| 1422 | −static void heap_bubble_down(AVFilterGraph *graph, | |
| 1422 | +static void heap_bubble_down(FFFilterGraph *graph, | |
| 1423 | 1423 | AVFilterLink *link, int index) |
| 1424 | 1424 | { |
| 1425 | 1425 | AVFilterLink **links = graph->sink_links; |
| @@ -1445,18 +1445,20 @@ static void heap_bubble_down(AVFilterGraph *graph, · 19 unmodified lines | ||
| 1445 | 1445 | |
| 1446 | 1446 | void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link) |
| 1447 | 1447 | { |
| 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); | |
| 1450 | 1451 | } |
| 1451 | 1452 | |
| 1452 | 1453 | int 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 | 1457 | int64_t frame_count; |
| 1456 | 1458 | int r; |
| 1457 | 1459 | |
| 1458 | − while (graph->sink_links_count) { | |
| 1459 | − oldest = graph->sink_links[0]; | |
| 1460 | + while (graphi->sink_links_count) { | |
| 1461 | + oldest = graphi->sink_links[0]; | |
| 1460 | 1462 | if (oldest->dst->filter->activate) { |
| 1461 | 1463 | r = av_buffersink_get_frame_flags(oldest->dst, NULL, |
| 1462 | 1464 | AV_BUFFERSINK_FLAG_PEEK); |
| @@ -1471,12 +1473,12 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) · 8 unmodified lines | ||
| 1471 | 1473 | oldest->dst->name, |
| 1472 | 1474 | oldest->dstpad->name); |
| 1473 | 1475 | /* 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], | |
| 1476 | 1478 | oldest->age_index); |
| 1477 | 1479 | oldest->age_index = -1; |
| 1478 | 1480 | } |
| 1479 | − if (!graph->sink_links_count) | |
| 1481 | + if (!graphi->sink_links_count) | |
| 1480 | 1482 | return AVERROR_EOF; |
| 1481 | 1483 | av_assert1(!oldest->dst->filter->activate); |
| 1482 | 1484 | av_assert1(oldest->age_index >= 0); |