History

lavfi: add ff_inoutlink_check_flow()

Nicolas George committed 4 years ago

Commit 531d09f1 parent 12139d12 files · +16 −0Browse files

Showing the changes to libavfilter (2 of 2 files). Show all

Unified · Split

2 files
  1. libavfilter/avfilter.c +8 −0
  2. libavfilter/filters.h +8 −0
libavfilter/avfilter.c+8−0
@@ -1559,6 +1559,14 @@ int ff_outlink_get_status(AVFilterLink *link) · 1558 unmodified lines
15591559 return link->status_in;
15601560 }
15611561
1562+int ff_inoutlink_check_flow(AVFilterLink *inlink, AVFilterLink *outlink)
1563+{
1564+ return ff_outlink_frame_wanted(outlink) ||
1565+ ff_inlink_check_available_frame(inlink) ||
1566+ inlink->status_out;
1567+}
1568+
1569+
15621570 const AVClass *avfilter_get_class(void)
15631571 {
15641572 return &avfilter_class;
libavfilter/filters.h+8−0
@@ -258,4 +258,12 @@ static inline void ff_outlink_set_status(AVFilterLink *link, int status, int64_t · 257 unmodified lines
258258 } \
259259 } while (0)
260260
261+/**
262+ * Check for flow control between input and output.
263+ * This is necessary for filters that may produce several output frames for
264+ * a single input event, otherwise they may produce them all at once,
265+ * causing excessive memory consumption.
266+ */
267+int ff_inoutlink_check_flow(AVFilterLink *inlink, AVFilterLink *outlink);
268+
261269 #endif /* AVFILTER_FILTERS_H */

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