+2006-07-19 Wim Taymans <wim@fluendo.com>
+
+ * gst-libs/gst/rtp/gstbasertpdepayload.c:
+ (gst_base_rtp_depayload_chain),
+ (gst_base_rtp_depayload_change_state):
+ Don't assert when not negotiated but post a meaningfull
+ error message. Fixes #347918.
+
+ * gst-libs/gst/rtp/gstbasertppayload.c:
+ Add comment about better default MTU size.
+
+ * gst-libs/gst/rtp/gstrtpbuffer.c: (gst_rtp_buffer_validate_data):
+ Small cleanups, start docs.
+
2006-07-19 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Martin Szulecki
filter = GST_BASE_RTP_DEPAYLOAD (GST_OBJECT_PARENT (pad));
- g_return_val_if_fail (filter->clock_rate > 0, GST_FLOW_ERROR);
+ if (filter->clock_rate <= 0)
+ goto not_configured;
bclass = GST_BASE_RTP_DEPAYLOAD_GET_CLASS (filter);
ret = bclass->add_to_queue (filter, in);
}
return ret;
+
+ /* ERRORS */
+not_configured:
+ {
+ GST_ELEMENT_ERROR (filter, STREAM, FORMAT,
+ (NULL), ("no clock rate was specified, likely incomplete input caps"));
+ return GST_FLOW_NOT_NEGOTIATED;
+ }
}
static gboolean
LAST_SIGNAL
};
+/* FIXME 0.11, a better default is the Ethernet MTU of
+ * 1500 - sizeof(headers) as pointed out by marcelm in IRC:
+ * So an Ethernet MTU of 1500, minus 60 for the max IP, minus 8 for UDP, gives
+ * 1432 bytes or so. And that should be adjusted downward further for other
+ * encapsulations like PPPoE, so 1400 at most.
+ */
#define DEFAULT_MTU 1024
#define DEFAULT_PT 96
#define DEFAULT_SSRC -1
/* GStreamer
* Copyright (C) <2005> Philippe Khalaf <burger@speedy.org>
+ * Copyright (C) <2006> Wim Taymans <wim@fluendo.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* Boston, MA 02111-1307, USA.
*/
+/**
+ * SECTION:gstrtpbuffer
+ * @short_description: Helper methods for dealing with RTP buffers
+ * @see_also: gstbasertppayload, gstbasertpdepayload
+ *
+ * <refsect2>
+ * <para>
+ * The GstRTPBuffer helper functions makes it easy to parse and create regular
+ * #GstBuffer objects that contain RTP payloads. These buffers are typically of
+ * 'application/x-rtp' #GstCaps.
+ * </para>
+ * </refsect2>
+ *
+ * Last reviewed on 2006-07-17 (0.10.10)
+ */
+
#include "gstrtpbuffer.h"
#define GST_RTP_HEADER_LEN 12
g_return_val_if_fail (data != NULL, FALSE);
header_len = GST_RTP_HEADER_LEN;
- if (len < header_len) {
- GST_DEBUG ("len < header_len check failed (%d < %d)", len, header_len);
- return FALSE;
- }
+ if (G_UNLIKELY (len < header_len))
+ goto wrong_length;
/* check version */
version = (data[0] & 0xc0) >> 6;
- if (version != GST_RTP_VERSION) {
- GST_DEBUG ("version check failed (%d != %d)", version, GST_RTP_VERSION);
- return FALSE;
- }
+ if (G_UNLIKELY (version != GST_RTP_VERSION))
+ goto wrong_version;
/* calc header length with csrc */
csrc_count = (data[0] & 0x0f);
padding = 0;
/* check if padding not bigger than packet and header */
- if (len - header_len <= padding) {
+ if (G_UNLIKELY (len - header_len <= padding))
+ goto wrong_padding;
+
+ return TRUE;
+
+ /* ERRORS */
+wrong_length:
+ {
+ GST_DEBUG ("len < header_len check failed (%d < %d)", len, header_len);
+ return FALSE;
+ }
+wrong_version:
+ {
+ GST_DEBUG ("version check failed (%d != %d)", version, GST_RTP_VERSION);
+ return FALSE;
+ }
+wrong_padding:
+ {
GST_DEBUG ("padding check failed (%d - %d <= %d)",
len, header_len, padding);
return FALSE;
}
-
- return TRUE;
}
gboolean