mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
aggregator: add gst_aggregator_pad_drop_buffer()
steal_buffer() + unref seems to be a wide-spread idiom (which perhaps indicates that something is not quite right with the way aggregator pad works currently).
This commit is contained in:
parent
55abf436a0
commit
592c2c8105
3 changed files with 25 additions and 0 deletions
|
@ -1323,6 +1323,8 @@ GstAggregatorPad
|
||||||
GstAggregatorPadClass
|
GstAggregatorPadClass
|
||||||
gst_aggregator_pad_steal_buffer
|
gst_aggregator_pad_steal_buffer
|
||||||
gst_aggregator_pad_get_buffer
|
gst_aggregator_pad_get_buffer
|
||||||
|
gst_aggregator_pad_drop_buffer
|
||||||
|
gst_aggregator_pad_is_eos
|
||||||
<SUBSECTION Standard>
|
<SUBSECTION Standard>
|
||||||
GST_IS_AGGREGATOR_PAD
|
GST_IS_AGGREGATOR_PAD
|
||||||
GST_IS_AGGREGATOR_PAD_CLASS
|
GST_IS_AGGREGATOR_PAD_CLASS
|
||||||
|
|
|
@ -2062,6 +2062,28 @@ gst_aggregator_pad_steal_buffer (GstAggregatorPad * pad)
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_aggregator_pad_drop_buffer:
|
||||||
|
* @pad: the pad where to drop any pending buffer
|
||||||
|
*
|
||||||
|
* Drop the buffer currently queued in @pad.
|
||||||
|
*
|
||||||
|
* Returns: TRUE if there was a buffer queued in @pad, or FALSE if not.
|
||||||
|
*/
|
||||||
|
gboolean
|
||||||
|
gst_aggregator_pad_drop_buffer (GstAggregatorPad * pad)
|
||||||
|
{
|
||||||
|
GstBuffer *buf;
|
||||||
|
|
||||||
|
buf = gst_aggregator_pad_steal_buffer (pad);
|
||||||
|
|
||||||
|
if (buf == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
gst_buffer_unref (buf);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_aggregator_pad_get_buffer:
|
* gst_aggregator_pad_get_buffer:
|
||||||
* @pad: the pad to get buffer from
|
* @pad: the pad to get buffer from
|
||||||
|
|
|
@ -104,6 +104,7 @@ GType gst_aggregator_pad_get_type (void);
|
||||||
|
|
||||||
GstBuffer * gst_aggregator_pad_steal_buffer (GstAggregatorPad * pad);
|
GstBuffer * gst_aggregator_pad_steal_buffer (GstAggregatorPad * pad);
|
||||||
GstBuffer * gst_aggregator_pad_get_buffer (GstAggregatorPad * pad);
|
GstBuffer * gst_aggregator_pad_get_buffer (GstAggregatorPad * pad);
|
||||||
|
gboolean gst_aggregator_pad_drop_buffer (GstAggregatorPad * pad);
|
||||||
gboolean gst_aggregator_pad_is_eos (GstAggregatorPad * pad);
|
gboolean gst_aggregator_pad_is_eos (GstAggregatorPad * pad);
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
|
|
Loading…
Reference in a new issue