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

Nicolas George george at nsup.org
Sat Dec 24 19:41:45 EET 2016


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

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 6d24f74c08..c3e30b80b7 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1645,6 +1645,14 @@ void ff_link_process_timeline(AVFilterLink *link, const AVFrame *frame)
     dstctx->is_disabled = fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) < 0.5;
 }
 
+void ff_link_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/internal.h b/libavfilter/internal.h
index 9aaf585eca..44d2fa38d5 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -690,4 +690,12 @@ void ff_link_process_commands(AVFilterLink *link, const AVFrame *frame);
  */
 void ff_link_process_timeline(AVFilterLink *link, const AVFrame *frame);
 
+/**
+ * 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_link_set_frame_wanted(AVFilterLink *link);
+
 #endif /* AVFILTER_INTERNAL_H */
-- 
2.11.0



More information about the ffmpeg-devel mailing list