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

Submitted by Paul B Mahol on Oct. 3, 2018, 11:03 a.m.

Details

Message ID 20181003110347.22904-1-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Oct. 3, 2018, 11:03 a.m.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavfilter/avfilter.c | 5 +++++
 libavfilter/filters.h  | 7 +++++++
 2 files changed, 12 insertions(+)

Comments

Nicolas George Oct. 3, 2018, 2:58 p.m.
Paul B Mahol (2018-10-03):
> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavfilter/avfilter.c | 5 +++++
>  libavfilter/filters.h  | 7 +++++++
>  2 files changed, 12 insertions(+)

LGTM. Please coordinate with Marton so that this function and the ones
he is about to add are in a logical order.

Regards,

Patch hide | download patch | download mbox

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