gst/rtsp/gstrtspsrc.c: Convert SDP fields to upper/lowercase following the rules in the SDP to caps document.

Original commit message from CVS:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_media_to_caps),
(gst_rtspsrc_activate_streams):
Convert SDP fields to upper/lowercase following the rules in the SDP to
caps document.
This commit is contained in:
Wim Taymans 2007-01-25 14:40:15 +00:00
parent 22eb34e2fe
commit 2de7376aaf
2 changed files with 26 additions and 7 deletions

View file

@ -1,3 +1,10 @@
2007-01-25 Wim Taymans <wim@fluendo.com>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_media_to_caps),
(gst_rtspsrc_activate_streams):
Convert SDP fields to upper/lowercase following the rules in the SDP to
caps document.
2007-01-25 Wim Taymans <wim@fluendo.com> 2007-01-25 Wim Taymans <wim@fluendo.com>
* gst/rtp/README: * gst/rtp/README:

View file

@ -610,6 +610,7 @@ gst_rtspsrc_media_to_caps (gint pt, SDPMedia * media)
gchar *name = NULL; gchar *name = NULL;
gint rate = -1; gint rate = -1;
gchar *params = NULL; gchar *params = NULL;
gchar *tmp1, *tmp2;
GstStructure *s; GstStructure *s;
/* dynamic payloads need rtpmap */ /* dynamic payloads need rtpmap */
@ -635,18 +636,26 @@ gst_rtspsrc_media_to_caps (gint pt, SDPMedia * media)
goto no_rtpmap; goto no_rtpmap;
} }
tmp1 = g_ascii_strdown (media->media, -1);
caps = gst_caps_new_simple ("application/x-unknown", caps = gst_caps_new_simple ("application/x-unknown",
"media", G_TYPE_STRING, media->media, "payload", G_TYPE_INT, pt, NULL); "media", G_TYPE_STRING, tmp1, "payload", G_TYPE_INT, pt, NULL);
g_free (tmp1);
s = gst_caps_get_structure (caps, 0); s = gst_caps_get_structure (caps, 0);
if (rate != -1) if (rate != -1)
gst_structure_set (s, "clock-rate", G_TYPE_INT, rate, NULL); gst_structure_set (s, "clock-rate", G_TYPE_INT, rate, NULL);
if (name != NULL) if (name != NULL) {
gst_structure_set (s, "encoding-name", G_TYPE_STRING, name, NULL); tmp1 = g_ascii_strup (name, -1);
gst_structure_set (s, "encoding-name", G_TYPE_STRING, tmp1, NULL);
g_free (tmp1);
}
if (params != NULL) if (params != NULL) {
gst_structure_set (s, "encoding-params", G_TYPE_STRING, params, NULL); tmp1 = g_ascii_strdown (params, -1);
gst_structure_set (s, "encoding-params", G_TYPE_STRING, tmp1, NULL);
g_free (tmp1);
}
/* parse optional fmtp: field */ /* parse optional fmtp: field */
if ((fmtp = sdp_media_get_attribute_val (media, "fmtp"))) { if ((fmtp = sdp_media_get_attribute_val (media, "fmtp"))) {
@ -680,8 +689,11 @@ gst_rtspsrc_media_to_caps (gint pt, SDPMedia * media)
} }
/* strip the key of spaces */ /* strip the key of spaces */
key = g_strstrip (pairs[i]); key = g_strstrip (pairs[i]);
tmp1 = g_ascii_strdown (key, -1);
gst_structure_set (s, key, G_TYPE_STRING, val, NULL); tmp2 = g_ascii_strdown (val, -1);
gst_structure_set (s, tmp1, G_TYPE_STRING, tmp2, NULL);
g_free (tmp1);
g_free (tmp2);
} }
g_strfreev (pairs); g_strfreev (pairs);
} }