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

Paul B Mahol onemda at gmail.com
Tue Oct 2 23:08:44 EEST 2018


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

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 85eff0aa1d..2dcaabf545 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -19,6 +19,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define ASSERT_LEVEL 5
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/buffer.h"
@@ -1453,6 +1454,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..06a0f5896b 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.
+  * @retrun 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