[FFmpeg-cvslog] lavfi: add ff_inlink_request_frame().

Nicolas George git at videolan.org
Thu Jan 12 15:15:34 EET 2017


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Sat Dec 24 13:16:59 2016 +0100| [9eb4c79afd437a2913088cb1593892625a3125fc] | committer: Nicolas George

lavfi: add ff_inlink_request_frame().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9eb4c79afd437a2913088cb1593892625a3125fc
---

 libavfilter/avfilter.c | 8 ++++++++
 libavfilter/filters.h  | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 741676a..75597d0 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1638,6 +1638,14 @@ int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *fram
     return fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) >= 0.5;
 }
 
+void ff_inlink_request_frame(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 fe3b612..2c78d60 100644
--- a/libavfilter/filters.h
+++ b/libavfilter/filters.h
@@ -126,4 +126,12 @@ int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe);
  */
 int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts);
 
+/**
+ * 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_request_frame(AVFilterLink *link);
+
 #endif /* AVFILTER_FILTERS_H */



More information about the ffmpeg-cvslog mailing list