[FFmpeg-devel] [PATCH 01/17] lavfi: add ff_link_acknowledge_status().

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


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

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 0020ee163a..c1858fb6a0 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1543,6 +1543,19 @@ int ff_filter_activate(AVFilterContext *filter)
     return ret;
 }
 
+int ff_link_acknowledge_status(AVFilterLink *link)
+{
+    if (ff_framequeue_queued_frames(&link->fifo))
+        return 0;
+    if (link->status_out)
+        return link->status_out;
+    if (!link->status_in)
+        return 0;
+    link->status_out = link->status_in;
+    ff_update_link_current_pts(link, link->status_in_pts);
+    return 1;
+}
+
 const AVClass *avfilter_get_class(void)
 {
     return &avfilter_class;
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 599be24a85..13666bc330 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -613,4 +613,10 @@ static inline int ff_norm_qscale(int qscale, int type)
  */
 int ff_filter_get_nb_threads(AVFilterContext *ctx);
 
+/**
+ * Test and acknowledge the change of status on the link.
+ * @return  >0 if status changed, 0 otherwise, <0 if status already acked
+ */
+int ff_link_acknowledge_status(AVFilterLink *link);
+
 #endif /* AVFILTER_INTERNAL_H */
-- 
2.11.0



More information about the ffmpeg-devel mailing list