From: Olivier CrĂȘte Date: Sun, 21 May 2017 12:34:13 +0000 (+0200) Subject: aggregator: Check for the result of caps events X-Git-Tag: 1.19.3~507^2~5198 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=20bf97f08912f0edb72bfdcdde4e5c40acb29823;p=platform%2Fupstream%2Fgstreamer.git aggregator: Check for the result of caps events https://bugzilla.gnome.org/show_bug.cgi?id=782918 --- diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c index 18eb6d9..abc0077 100644 --- a/gst-libs/gst/base/gstaggregator.c +++ b/gst-libs/gst/base/gstaggregator.c @@ -221,6 +221,8 @@ struct _GstAggregatorPadPrivate GstClockTime time_level; GstSegment head_segment; /* segment before the queue */ + gboolean negotiated; + gboolean eos; GMutex lock; @@ -762,18 +764,29 @@ check_events (GstAggregator * self, GstAggregatorPad * pad, gpointer user_data) } if (pad->priv->clipped_buffer == NULL && GST_IS_EVENT (g_queue_peek_tail (&pad->priv->buffers))) { - event = g_queue_pop_tail (&pad->priv->buffers); - PAD_BROADCAST_EVENT (pad); + event = gst_event_ref (g_queue_peek_tail (&pad->priv->buffers)); } PAD_UNLOCK (pad); if (event) { + gboolean ret; + if (processed_event) *processed_event = TRUE; if (klass == NULL) klass = GST_AGGREGATOR_GET_CLASS (self); GST_LOG_OBJECT (pad, "Processing %" GST_PTR_FORMAT, event); - klass->sink_event (self, pad, event); + gst_event_ref (event); + ret = klass->sink_event (self, pad, event); + + PAD_LOCK (pad); + if (GST_EVENT_TYPE (event) == GST_EVENT_CAPS) + pad->priv->negotiated = ret; + if (g_queue_peek_tail (&pad->priv->buffers) == event) + gst_event_unref (g_queue_pop_tail (&pad->priv->buffers)); + gst_event_unref (event); + PAD_BROADCAST_EVENT (pad); + PAD_UNLOCK (pad); } } while (event != NULL); @@ -1479,6 +1492,10 @@ gst_aggregator_stop_pad (GstAggregator * self, GstAggregatorPad * pad, { gst_aggregator_pad_flush (pad, self); + PAD_LOCK (pad); + pad->priv->negotiated = FALSE; + PAD_UNLOCK (pad); + return TRUE; } @@ -2717,6 +2734,7 @@ gst_aggregator_pad_init (GstAggregatorPad * pad) g_mutex_init (&pad->priv->lock); gst_aggregator_pad_reset_unlocked (pad); + pad->priv->negotiated = FALSE; } /* Must be called with the PAD_LOCK held */