rtp: improve basertpdepayload's error message when no input caps were set

This is pretty much an FAQ, so try to make the error message a bit
more helpful. Also, don't tell people to file a bug in bugzilla
about this (which is what happens if the default error message for
CORE_NEGOTIATION is used).
This commit is contained in:
Tim-Philipp Müller 2010-09-06 18:17:10 +01:00
parent 9fd1c48267
commit b550eabdac

View file

@ -240,10 +240,15 @@ gst_base_rtp_depayload_setcaps (GstPad * pad, GstCaps * caps)
else else
priv->play_scale = 1.0; priv->play_scale = 1.0;
if (bclass->set_caps) if (bclass->set_caps) {
res = bclass->set_caps (filter, caps); res = bclass->set_caps (filter, caps);
else if (!res) {
GST_WARNING_OBJECT (filter, "Subclass rejected caps %" GST_PTR_FORMAT,
caps);
}
} else {
res = TRUE; res = TRUE;
}
priv->negotiated = res; priv->negotiated = res;
@ -357,8 +362,22 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in)
not_negotiated: not_negotiated:
{ {
/* this is not fatal but should be filtered earlier */ /* this is not fatal but should be filtered earlier */
GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION, (NULL), if (GST_BUFFER_CAPS (in) == NULL) {
("Not RTP format was negotiated")); GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION,
("No RTP format was negotiated."),
("Input buffers need to have RTP caps set on them. This is usually "
"achieved by setting the 'caps' property of the upstream source "
"element (often udpsrc or appsrc), or by putting a capsfilter "
"element before the depayloader and setting the 'caps' property "
"on that. Also see http://cgit.freedesktop.org/gstreamer/"
"gst-plugins-good/tree/gst/rtp/README"));
} else {
GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION,
("No RTP format was negotiated."),
("RTP caps on input buffer were rejected, most likely because they "
"were incomplete or contained wrong values. Check the debug log "
"for more information."));
}
gst_buffer_unref (in); gst_buffer_unref (in);
return GST_FLOW_NOT_NEGOTIATED; return GST_FLOW_NOT_NEGOTIATED;
} }