[FFmpeg-devel] [PATCH 13/17] lavfi: add ff_inlink_set_frame_wanted().

Nicolas George george at nsup.org
Thu Dec 29 16:33:59 EET 2016


Signed-off-by: Nicolas George <george at nsup.org>
---
 libavfilter/avfilter.c | 8 ++++++++
 libavfilter/filters.h  | 8 ++++++++
 2 files changed, 16 insertions(+)


Changes in this commit: rename ff_link -> ff_inlink and move to filters.h.


diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 7e02d9ca8b..d7677d5f23 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1634,6 +1634,14 @@ void ff_inlink_process_timeline(AVFilterLink *link, const AVFrame *frame)
     dstctx->is_disabled = fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) < 0.5;
 }
 
+void ff_inlink_set_frame_wanted(AVFilterLink *link)
+{
+    av_assert1(!link->status_in);
+    av_assert1(!link->status_out);
+    link->frame_wanted_out = 1;
+    ff_filter_set_ready(link->src, 100);
+}
+
 const AVClass *avfilter_get_class(void)
 {
     return &avfilter_class;
diff --git a/libavfilter/filters.h b/libavfilter/filters.h
index 95df86c911..4ffddf117f 100644
--- a/libavfilter/filters.h
+++ b/libavfilter/filters.h
@@ -100,4 +100,12 @@ int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe);
  */
 int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus);
 
+/**
+ * Mark that a frame is wanted on the link.
+ * Unlike ff_filter_frame(), it must not be called when the link has a
+ * non-zero status, and thus does not acknowledge it.
+ * Also it cannot fail.
+ */
+void ff_inlink_set_frame_wanted(AVFilterLink *link);
+
 #endif /* AVFILTER_FILTERS_H */
-- 
2.11.0



More information about the ffmpeg-devel mailing list