gst-libs/gst/sdp/gstsdpmessage.c: Fix parsing of the c= field containing multicast addresses.

Original commit message from CVS:
Based on Patch by: Tero Saarni <tero dot saarni at gmail dot com>
* gst-libs/gst/sdp/gstsdpmessage.c: (gst_sdp_parse_line),
(print_media), (gst_sdp_message_dump):
Fix parsing of the c= field containing multicast addresses.
Fixes #552199.
Add the connection info to the session or streams.
Fix parsing of the bandwidth.
Add debugging for the connections and bandwidths for a media.
Add debugging for the bandwidth of the session.
This commit is contained in:
Tero Saarni 2008-10-06 16:36:20 +00:00 committed by Wim Taymans
parent a2eb053641
commit 2f96504ff9
2 changed files with 78 additions and 5 deletions

View file

@ -1,3 +1,16 @@
2008-10-06 Wim Taymans <wim.taymans@collabora.co.uk>
Based on Patch by: Tero Saarni <tero dot saarni at gmail dot com>
* gst-libs/gst/sdp/gstsdpmessage.c: (gst_sdp_parse_line),
(print_media), (gst_sdp_message_dump):
Fix parsing of the c= field containing multicast addresses.
Fixes #552199.
Add the connection info to the session or streams.
Fix parsing of the bandwidth.
Add debugging for the connections and bandwidths for a media.
Add debugging for the bandwidth of the session.
2008-10-06 Wim Taymans <wim.taymans@collabora.co.uk>
* gst-libs/gst/rtp/gstbasertppayload.c:

View file

@ -1743,17 +1743,38 @@ gst_sdp_parse_line (SDPContext * c, gchar type, gchar * buffer)
gst_sdp_message_add_phone (c->msg, buffer);
break;
case 'c':
READ_STRING (c->msg->connection.nettype);
READ_STRING (c->msg->connection.addrtype);
READ_STRING (c->msg->connection.address);
READ_UINT (c->msg->connection.ttl);
READ_UINT (c->msg->connection.addr_number);
{
GstSDPConnection conn;
gchar *str2;
memset (&conn, 0, sizeof (conn));
str2 = p;
while ((str2 = strchr (str2, '/')))
*str2++ = ' ';
READ_STRING (conn.nettype);
READ_STRING (conn.addrtype);
READ_STRING (conn.address);
READ_UINT (conn.ttl);
READ_UINT (conn.addr_number);
if (c->state == SDP_SESSION) {
gst_sdp_message_set_connection (c->msg, conn.nettype, conn.addrtype,
conn.address, conn.ttl, conn.addr_number);
} else {
gst_sdp_media_add_connection (c->media, conn.nettype, conn.addrtype,
conn.address, conn.ttl, conn.addr_number);
}
gst_sdp_connection_init (&conn);
break;
}
case 'b':
{
gchar str2[MAX_LINE_LEN];
read_string_del (str, sizeof (str), ':', &p);
if (*p != '\0')
p++;
read_string (str2, sizeof (str2), &p);
if (c->state == SDP_SESSION)
gst_sdp_message_add_bandwidth (c->msg, str, atoi (str2));
@ -1889,6 +1910,33 @@ print_media (GstSDPMedia * media)
}
}
g_print (" information: '%s'\n", GST_STR_NULL (media->information));
if (media->connections->len > 0) {
guint i;
g_print (" connections:\n");
for (i = 0; i < media->connections->len; i++) {
GstSDPConnection *conn =
&g_array_index (media->connections, GstSDPConnection, i);
g_print (" nettype: '%s'\n", GST_STR_NULL (conn->nettype));
g_print (" addrtype: '%s'\n", GST_STR_NULL (conn->addrtype));
g_print (" address: '%s'\n", GST_STR_NULL (conn->address));
g_print (" ttl: '%u'\n", conn->ttl);
g_print (" addr_number: '%u'\n", conn->addr_number);
}
}
if (media->bandwidths->len > 0) {
guint i;
g_print (" bandwidths:\n");
for (i = 0; i < media->bandwidths->len; i++) {
GstSDPBandwidth *bw =
&g_array_index (media->bandwidths, GstSDPBandwidth, i);
g_print (" type: '%s'\n", GST_STR_NULL (bw->bwtype));
g_print (" bandwidth: '%u'\n", bw->bandwidth);
}
}
g_print (" key:\n");
g_print (" type: '%s'\n", GST_STR_NULL (media->key.type));
g_print (" data: '%s'\n", GST_STR_NULL (media->key.data));
@ -1953,6 +2001,18 @@ gst_sdp_message_dump (const GstSDPMessage * msg)
g_print (" address: '%s'\n", GST_STR_NULL (msg->connection.address));
g_print (" ttl: '%u'\n", msg->connection.ttl);
g_print (" addr_number: '%u'\n", msg->connection.addr_number);
if (msg->bandwidths->len > 0) {
guint i;
g_print (" bandwidths:\n");
for (i = 0; i < msg->bandwidths->len; i++) {
GstSDPBandwidth *bw =
&g_array_index (msg->bandwidths, GstSDPBandwidth, i);
g_print (" type: '%s'\n", GST_STR_NULL (bw->bwtype));
g_print (" bandwidth: '%u'\n", bw->bandwidth);
}
}
g_print (" key:\n");
g_print (" type: '%s'\n", GST_STR_NULL (msg->key.type));
g_print (" data: '%s'\n", GST_STR_NULL (msg->key.data));