aggregator: Add API to check if a pad has a new buffer

https://bugzilla.gnome.org/show_bug.cgi?id=795332
This commit is contained in:
Olivier Crête 2018-04-23 11:34:19 -04:00
parent 42fda19a7c
commit 2821126d60
3 changed files with 25 additions and 0 deletions

View file

@ -245,6 +245,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
<SUBSECTION Standard>
GST_IS_AGGREGATOR_PAD
GST_IS_AGGREGATOR_PAD_CLASS

View file

@ -2945,6 +2945,27 @@ gst_aggregator_pad_peek_buffer (GstAggregatorPad * pad)
return buffer;
}
/**
* 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

View file

@ -111,6 +111,9 @@ GstBuffer * gst_aggregator_pad_peek_buffer (GstAggregatorPad * pad);
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);