rtsp: place a- and x- properties as attributes

application/x-rtp has properties with a- and x- prefixes that should be
placed as attributes in the SDP for the media instead of being added to the
fmtp.
This commit is contained in:
Wim Taymans 2013-05-31 15:41:55 +02:00
parent d1339f60f4
commit cfdf2e6db5

View file

@ -179,7 +179,7 @@ gst_rtsp_sdp_from_media (GstSDPMessage * sdp, GstSDPInfo * info,
gst_sdp_media_add_attribute (smedia, "control", tmp);
g_free (tmp);
/* collect all other properties and add them to fmtp */
/* collect all other properties and add them to fmtp or attributes */
fmtp = g_string_new ("");
g_string_append_printf (fmtp, "%d ", caps_pt);
first = TRUE;
@ -213,6 +213,19 @@ gst_rtsp_sdp_from_media (GstSDPMessage * sdp, GstSDPInfo * info,
if (!strcmp (fname, "framerate"))
continue;
if (g_str_has_prefix (fname, "a-")) {
/* attribute */
if ((fval = gst_structure_get_string (s, fname)))
gst_sdp_media_add_attribute (smedia, fname + 2, fval);
continue;
}
if (g_str_has_prefix (fname, "x-")) {
/* attribute */
if ((fval = gst_structure_get_string (s, fname)))
gst_sdp_media_add_attribute (smedia, fname, fval);
continue;
}
if ((fval = gst_structure_get_string (s, fname))) {
g_string_append_printf (fmtp, "%s%s=%s", first ? "" : ";", fname, fval);
first = FALSE;