From: Olivier CrĂȘte Date: Mon, 23 Apr 2018 15:34:19 +0000 (-0400) Subject: aggregator: Add API to check if a pad has a new buffer X-Git-Tag: 1.16.2~392 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dda9a9998915e248fa65867caa7ca12943145507;p=platform%2Fupstream%2Fgstreamer.git aggregator: Add API to check if a pad has a new buffer https://bugzilla.gnome.org/show_bug.cgi?id=795332 --- diff --git a/docs/libs/gstreamer-libs-sections.txt b/docs/libs/gstreamer-libs-sections.txt index d7d5634..1da69ce 100644 --- a/docs/libs/gstreamer-libs-sections.txt +++ b/docs/libs/gstreamer-libs-sections.txt @@ -252,6 +252,7 @@ gst_aggregator_pad_pop_buffer gst_aggregator_pad_peek_buffer gst_aggregator_pad_drop_buffer gst_aggregator_pad_is_eos +gst_aggregator_pad_has_buffer GST_IS_AGGREGATOR_PAD GST_IS_AGGREGATOR_PAD_CLASS diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 3051a17..b67f36d 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -2946,6 +2946,27 @@ gst_aggregator_pad_peek_buffer (GstAggregatorPad * pad) } /** + * gst_aggregator_pad_has_buffer: + * @pad: the pad to check the buffer on + * + * Returns: %TRUE if the pad has a buffer available as the next thing. + * + * Since: 1.16 + */ +gboolean +gst_aggregator_pad_has_buffer (GstAggregatorPad * pad) +{ + gboolean has_buffer; + + PAD_LOCK (pad); + gst_aggregator_pad_clip_buffer_unlocked (pad); + has_buffer = (pad->priv->clipped_buffer != NULL); + PAD_UNLOCK (pad); + + return has_buffer; +} + +/** * gst_aggregator_pad_is_eos: * @pad: an aggregator pad * diff --git a/libs/gst/base/gstaggregator.h b/libs/gst/base/gstaggregator.h index df4e8e3..122ee3e 100644 --- a/libs/gst/base/gstaggregator.h +++ b/libs/gst/base/gstaggregator.h @@ -113,6 +113,9 @@ GST_BASE_API gboolean gst_aggregator_pad_drop_buffer (GstAggregatorPad * pad); GST_BASE_API +gboolean gst_aggregator_pad_has_buffer (GstAggregatorPad * pad); + +GST_BASE_API gboolean gst_aggregator_pad_is_eos (GstAggregatorPad * pad); /*********************