From b550eabdac0c3f6d023d0913d58c9cf76117546a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 6 Sep 2010 18:17:10 +0100 Subject: [PATCH] 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). --- gst-libs/gst/rtp/gstbasertpdepayload.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/rtp/gstbasertpdepayload.c b/gst-libs/gst/rtp/gstbasertpdepayload.c index 1bdf523..3bee2ab 100644 --- a/gst-libs/gst/rtp/gstbasertpdepayload.c +++ b/gst-libs/gst/rtp/gstbasertpdepayload.c @@ -240,10 +240,15 @@ gst_base_rtp_depayload_setcaps (GstPad * pad, GstCaps * caps) else priv->play_scale = 1.0; - if (bclass->set_caps) + if (bclass->set_caps) { res = bclass->set_caps (filter, caps); - else + if (!res) { + GST_WARNING_OBJECT (filter, "Subclass rejected caps %" GST_PTR_FORMAT, + caps); + } + } else { res = TRUE; + } priv->negotiated = res; @@ -357,8 +362,22 @@ gst_base_rtp_depayload_chain (GstPad * pad, GstBuffer * in) not_negotiated: { /* this is not fatal but should be filtered earlier */ - GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION, (NULL), - ("Not RTP format was negotiated")); + if (GST_BUFFER_CAPS (in) == NULL) { + 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); return GST_FLOW_NOT_NEGOTIATED; } -- 2.7.4