History

lavfi: add a new struct for private link properties

Specifically those that should be visible to filters, but hidden from API callers. Such properties are currently located at the end of the public AVFilterLink struct, demarcated by a comment marking them as private. However it is generally better to hide them explicitly, using the same pattern already employed in avformat or avcodec. The new struct is currently trivial, but will become more useful in following commits.

Anton Khirnov committed 2 years ago

Commit 54754ee1 parent 426e33c4 files · +22 −11Browse files

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

Unified · Split

libavfilter/avfiltergraph.c+5−5
@@ -1326,7 +1326,7 @@ static void heap_bubble_up(FFFilterGraph *graph, · 1325 unmodified lines
13261326
13271327 while (index) {
13281328 int parent = (index - 1) >> 1;
1329− if (links[parent]->l.current_pts_us >= li->l.current_pts_us)
1329+ if (links[parent]->l.pub.current_pts_us >= li->l.pub.current_pts_us)
13301330 break;
13311331 links[index] = links[parent];
13321332 links[index]->age_index = index;
@@ -1348,9 +1348,9 @@ static void heap_bubble_down(FFFilterGraph *graph, · 15 unmodified lines
13481348 if (child >= graph->sink_links_count)
13491349 break;
13501350 if (child + 1 < graph->sink_links_count &&
1351− links[child + 1]->l.current_pts_us < links[child]->l.current_pts_us)
1351+ links[child + 1]->l.pub.current_pts_us < links[child]->l.pub.current_pts_us)
13521352 child++;
1353− if (li->l.current_pts_us < links[child]->l.current_pts_us)
1353+ if (li->l.pub.current_pts_us < links[child]->l.pub.current_pts_us)
13541354 break;
13551355 links[index] = links[child];
13561356 links[index]->age_index = index;
@@ -1372,13 +1372,13 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) · 15 unmodified lines
13721372 {
13731373 FFFilterGraph *graphi = fffiltergraph(graph);
13741374 FilterLinkInternal *oldesti = graphi->sink_links[0];
1375− AVFilterLink *oldest = &oldesti->l;
1375+ AVFilterLink *oldest = &oldesti->l.pub;
13761376 int64_t frame_count;
13771377 int r;
13781378
13791379 while (graphi->sink_links_count) {
13801380 oldesti = graphi->sink_links[0];
1381− oldest = &oldesti->l;
1381+ oldest = &oldesti->l.pub;
13821382 if (oldest->dst->filter->activate) {
13831383 r = av_buffersink_get_frame_flags(oldest->dst, NULL,
13841384 AV_BUFFERSINK_FLAG_PEEK);

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