From 93bdbb6acdf8fdbd9e68c8906f4e96172aeed1a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 9 Mar 2015 10:21:49 +0100 Subject: [PATCH] rtsp-media: Don't include payload type in the caps for framesize When the sdp media attribute framesize are converted to caps the should not be included. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725335 Based on the patch for rtspsrc by Linus Svensson --- gst/rtsp-server/rtsp-media.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index fa5f410..7932236 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -3129,6 +3129,7 @@ parse_rtpmap (const gchar * rtpmap, gint * payload, gchar ** name, * Mapping of caps to and from SDP fields: * * a=rtpmap: /[/] + * a=framesize: - * a=fmtp: [=];... */ static GstCaps * @@ -3137,6 +3138,7 @@ media_to_caps (gint pt, const GstSDPMedia * media) GstCaps *caps; const gchar *rtpmap; const gchar *fmtp; + const gchar *framesize; gchar *name = NULL; gint rate = -1; gchar *params = NULL; @@ -3250,6 +3252,19 @@ media_to_caps (gint pt, const GstSDPMedia * media) g_strfreev (pairs); } } + + /* parse framesize: field */ + if ((framesize = gst_sdp_media_get_attribute_val (media, "framesize"))) { + gchar *p; + + /* p is now of the format - */ + p = (gchar *) framesize; + + PARSE_INT (p, " ", payload); + if (payload != -1 && payload == pt) { + gst_structure_set (s, "a-framesize", G_TYPE_STRING, p, NULL); + } + } return caps; /* ERRORS */ @@ -3441,6 +3456,8 @@ sdp_attributes_to_caps (GArray * attributes, GstCaps * caps) continue; if (!strcmp (key, "range")) continue; + if (!strcmp (key, "framesize")) + continue; if (g_str_equal (key, "key-mgmt")) { parse_keymgmt (attr->value, caps); continue; -- 2.7.4