mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
aggregator: use new gst_aggregator_pad_drop_buffer()
This commit is contained in:
parent
592c2c8105
commit
3c2ee8ece5
2 changed files with 6 additions and 15 deletions
|
@ -778,14 +778,13 @@ static void
|
||||||
gst_aggregator_flush_start (GstAggregator * self, GstAggregatorPad * aggpad,
|
gst_aggregator_flush_start (GstAggregator * self, GstAggregatorPad * aggpad,
|
||||||
GstEvent * event)
|
GstEvent * event)
|
||||||
{
|
{
|
||||||
GstBuffer *tmpbuf;
|
|
||||||
GstAggregatorPrivate *priv = self->priv;
|
GstAggregatorPrivate *priv = self->priv;
|
||||||
GstAggregatorPadPrivate *padpriv = aggpad->priv;
|
GstAggregatorPadPrivate *padpriv = aggpad->priv;
|
||||||
|
|
||||||
g_atomic_int_set (&aggpad->priv->flushing, TRUE);
|
g_atomic_int_set (&aggpad->priv->flushing, TRUE);
|
||||||
|
|
||||||
/* Remove pad buffer and wake up the streaming thread */
|
/* Remove pad buffer and wake up the streaming thread */
|
||||||
tmpbuf = gst_aggregator_pad_steal_buffer (aggpad);
|
gst_aggregator_pad_drop_buffer (aggpad);
|
||||||
gst_buffer_replace (&tmpbuf, NULL);
|
|
||||||
|
|
||||||
PAD_STREAM_LOCK (aggpad);
|
PAD_STREAM_LOCK (aggpad);
|
||||||
PAD_LOCK (aggpad);
|
PAD_LOCK (aggpad);
|
||||||
|
@ -822,8 +821,7 @@ gst_aggregator_flush_start (GstAggregator * self, GstAggregatorPad * aggpad,
|
||||||
}
|
}
|
||||||
PAD_STREAM_UNLOCK (aggpad);
|
PAD_STREAM_UNLOCK (aggpad);
|
||||||
|
|
||||||
tmpbuf = gst_aggregator_pad_steal_buffer (aggpad);
|
gst_aggregator_pad_drop_buffer (aggpad);
|
||||||
gst_buffer_replace (&tmpbuf, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GstAggregator vmethods default implementations */
|
/* GstAggregator vmethods default implementations */
|
||||||
|
@ -1028,7 +1026,6 @@ static void
|
||||||
gst_aggregator_release_pad (GstElement * element, GstPad * pad)
|
gst_aggregator_release_pad (GstElement * element, GstPad * pad)
|
||||||
{
|
{
|
||||||
GstAggregator *self = GST_AGGREGATOR (element);
|
GstAggregator *self = GST_AGGREGATOR (element);
|
||||||
GstBuffer *tmpbuf;
|
|
||||||
|
|
||||||
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
|
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
|
||||||
|
|
||||||
|
@ -1036,8 +1033,7 @@ gst_aggregator_release_pad (GstElement * element, GstPad * pad)
|
||||||
|
|
||||||
SRC_STREAM_LOCK (self);
|
SRC_STREAM_LOCK (self);
|
||||||
g_atomic_int_set (&aggpad->priv->flushing, TRUE);
|
g_atomic_int_set (&aggpad->priv->flushing, TRUE);
|
||||||
tmpbuf = gst_aggregator_pad_steal_buffer (aggpad);
|
gst_aggregator_pad_drop_buffer (aggpad);
|
||||||
gst_buffer_replace (&tmpbuf, NULL);
|
|
||||||
gst_element_remove_pad (element, pad);
|
gst_element_remove_pad (element, pad);
|
||||||
|
|
||||||
SRC_STREAM_BROADCAST (self);
|
SRC_STREAM_BROADCAST (self);
|
||||||
|
@ -1996,11 +1992,8 @@ static void
|
||||||
gst_aggregator_pad_dispose (GObject * object)
|
gst_aggregator_pad_dispose (GObject * object)
|
||||||
{
|
{
|
||||||
GstAggregatorPad *pad = (GstAggregatorPad *) object;
|
GstAggregatorPad *pad = (GstAggregatorPad *) object;
|
||||||
GstBuffer *buf;
|
|
||||||
|
|
||||||
buf = gst_aggregator_pad_steal_buffer (pad);
|
gst_aggregator_pad_drop_buffer (pad);
|
||||||
if (buf)
|
|
||||||
gst_buffer_unref (buf);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (gst_aggregator_pad_parent_class)->dispose (object);
|
G_OBJECT_CLASS (gst_aggregator_pad_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,6 @@ gst_test_aggregator_aggregate (GstAggregator * aggregator, gboolean timeout)
|
||||||
|
|
||||||
iter = gst_element_iterate_sink_pads (GST_ELEMENT (testagg));
|
iter = gst_element_iterate_sink_pads (GST_ELEMENT (testagg));
|
||||||
while (!done_iterating) {
|
while (!done_iterating) {
|
||||||
GstBuffer *buffer;
|
|
||||||
GValue value = { 0, };
|
GValue value = { 0, };
|
||||||
GstAggregatorPad *pad;
|
GstAggregatorPad *pad;
|
||||||
|
|
||||||
|
@ -86,8 +85,7 @@ gst_test_aggregator_aggregate (GstAggregator * aggregator, gboolean timeout)
|
||||||
|
|
||||||
if (gst_aggregator_pad_is_eos (pad) == FALSE)
|
if (gst_aggregator_pad_is_eos (pad) == FALSE)
|
||||||
all_eos = FALSE;
|
all_eos = FALSE;
|
||||||
buffer = gst_aggregator_pad_steal_buffer (pad);
|
gst_aggregator_pad_drop_buffer (pad);
|
||||||
gst_buffer_replace (&buffer, NULL);
|
|
||||||
|
|
||||||
g_value_reset (&value);
|
g_value_reset (&value);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue