mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
aggregator: Don't send multiple caps events with the same caps
Every time aggregator is reconfiguring it will try to negotiate new caps. If these resulting caps are the same as the previously negotiated caps then don't send a new caps event with the same caps again. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2372>
This commit is contained in:
parent
d2c6f21fc1
commit
b247305bfd
1 changed files with 15 additions and 0 deletions
|
@ -671,7 +671,22 @@ gst_aggregator_push_mandatory_events (GstAggregator * self, gboolean up_to_caps)
|
||||||
void
|
void
|
||||||
gst_aggregator_set_src_caps (GstAggregator * self, GstCaps * caps)
|
gst_aggregator_set_src_caps (GstAggregator * self, GstCaps * caps)
|
||||||
{
|
{
|
||||||
|
GstCaps *old_caps;
|
||||||
|
|
||||||
GST_PAD_STREAM_LOCK (self->srcpad);
|
GST_PAD_STREAM_LOCK (self->srcpad);
|
||||||
|
|
||||||
|
if (caps && (old_caps = gst_pad_get_current_caps (self->srcpad))) {
|
||||||
|
if (gst_caps_is_equal (caps, old_caps)) {
|
||||||
|
GST_DEBUG_OBJECT (self,
|
||||||
|
"New caps are the same as the previously set caps %" GST_PTR_FORMAT,
|
||||||
|
old_caps);
|
||||||
|
gst_caps_unref (old_caps);
|
||||||
|
GST_PAD_STREAM_UNLOCK (self->srcpad);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
gst_caps_unref (old_caps);
|
||||||
|
}
|
||||||
|
|
||||||
gst_caps_replace (&self->priv->srccaps, caps);
|
gst_caps_replace (&self->priv->srccaps, caps);
|
||||||
gst_aggregator_push_mandatory_events (self, TRUE);
|
gst_aggregator_push_mandatory_events (self, TRUE);
|
||||||
GST_PAD_STREAM_UNLOCK (self->srcpad);
|
GST_PAD_STREAM_UNLOCK (self->srcpad);
|
||||||
|
|
Loading…
Reference in a new issue