[FFmpeg-devel] [PATCH 1/4] avfilter: add ff_inlink_queued_samples()

Paul B Mahol onemda at gmail.com
Wed Oct 3 14:03:44 EEST 2018


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavfilter/avfilter.c | 5 +++++
 libavfilter/filters.h  | 7 +++++++
 2 files changed, 12 insertions(+)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 85eff0aa1d..49046f4ede 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -1453,6 +1453,11 @@ int ff_inlink_check_available_frame(AVFilterLink *link)
     return ff_framequeue_queued_frames(&link->fifo) > 0;
 }
 
+int ff_inlink_queued_samples(AVFilterLink *link)
+{
+    return ff_framequeue_queued_samples(&link->fifo);
+}
+
 int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min)
 {
     uint64_t samples = ff_framequeue_queued_samples(&link->fifo);
diff --git a/libavfilter/filters.h b/libavfilter/filters.h
index 4e2652ebe5..18a65e91fc 100644
--- a/libavfilter/filters.h
+++ b/libavfilter/filters.h
@@ -66,6 +66,13 @@ int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *fram
  */
 int ff_inlink_check_available_frame(AVFilterLink *link);
 
+
+/***
+  * Get the number of samples available on the link.
+  * @return the numer of samples available on the link.
+  */
+int ff_inlink_queued_samples(AVFilterLink *link);
+
 /**
  * Test if enough samples are available on the link.
  * @return  >0 if enough samples are available
-- 
2.17.1



More information about the ffmpeg-devel mailing list