mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 18:22:23 +00:00
Error out more specifically on empty caps
When we get empty caps from the getcaps function in the default negotiate function, post a more descriptive error.
This commit is contained in:
parent
dcc6ab2cce
commit
79c3c6a339
1 changed files with 12 additions and 0 deletions
|
@ -2366,6 +2366,9 @@ gst_base_src_default_negotiate (GstBaseSrc * basesrc)
|
||||||
if (thiscaps == NULL || gst_caps_is_any (thiscaps))
|
if (thiscaps == NULL || gst_caps_is_any (thiscaps))
|
||||||
goto no_nego_needed;
|
goto no_nego_needed;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (gst_caps_is_empty (thiscaps)))
|
||||||
|
goto no_caps;
|
||||||
|
|
||||||
/* get the peer caps */
|
/* get the peer caps */
|
||||||
peercaps = gst_pad_peer_get_caps (GST_BASE_SRC_PAD (basesrc));
|
peercaps = gst_pad_peer_get_caps (GST_BASE_SRC_PAD (basesrc));
|
||||||
GST_DEBUG_OBJECT (basesrc, "caps of peer: %" GST_PTR_FORMAT, peercaps);
|
GST_DEBUG_OBJECT (basesrc, "caps of peer: %" GST_PTR_FORMAT, peercaps);
|
||||||
|
@ -2418,6 +2421,15 @@ no_nego_needed:
|
||||||
gst_caps_unref (thiscaps);
|
gst_caps_unref (thiscaps);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
no_caps:
|
||||||
|
{
|
||||||
|
GST_ELEMENT_ERROR (basesrc, STREAM, FORMAT,
|
||||||
|
("No supported formats found"),
|
||||||
|
("This element did not produce valid caps"));
|
||||||
|
if (thiscaps)
|
||||||
|
gst_caps_unref (thiscaps);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue