GNOME Bugzilla – Bug 702063
SDP response includes remote address where the local should be
Last modified: 2014-02-25 22:28:39 UTC
Created attachment 246595 [details] [review] Patch In the response from the rtsp-server we get: c=IN IP4 192.168.0.1 Note that 192.168.0.1 is not the IP of the rtsp server host, it's the client ip that is connecting to the rtsp server. This is wrong. **** Before patch: Received response: RTSP/1.0 200 OK CSeq: 0 Content-Type: application/sdp Content-Base: rtsp://192.168.0.90/axis-media/media.amp/ Server: GStreamer RTSP server Date: Wed, 12 Jun 2013 10:08:04 GMT Content-Length: 433 v=0 o=- 1188340656180883 1 IN IP4 192.168.0.1 s=Session streamed with GStreamer i=rtsp-server t=0 0 a=tool:GStreamer a=type:broadcast a=control:* a=range:npt=now- m=video 0 RTP/AVP 96 c=IN IP4 192.168.0.1 b=AS:50 a=rtpmap:96 H264/90000 a=control:stream=0 a=fmtp:96 sprop-parameter-sets=Z00AMuKQBRAevy4C3AQEBpB4kRU=,aO48gA== a=transform:1.000000,0.000000,0.000000;0.000000,1.000000,0.000000;0.000000,0.000000,1.000000 **** After patch: Send request: DESCRIBE rtsp://192.168.0.90/axis-media/media.amp RTSP/1.0 CSeq: 0 User-Agent: Axis AMC Accept: application/sdp Authorization: Basic cm9vdDpwYXNz Received response: RTSP/1.0 200 OK CSeq: 0 Content-Type: application/sdp Content-Base: rtsp://192.168.0.90/axis-media/media.amp/ Server: GStreamer RTSP server Date: Wed, 12 Jun 2013 10:04:44 GMT Content-Length: 435 v=0 o=- 1188340656180883 1 IN IP4 192.168.0.90 s=Session streamed with GStreamer i=rtsp-server t=0 0 a=tool:GStreamer a=type:broadcast a=control:* a=range:npt=now- m=video 0 RTP/AVP 96 c=IN IP4 192.168.0.90 b=AS:50 a=rtpmap:96 H264/90000 a=control:stream=0 a=fmtp:96 sprop-parameter-sets=Z00AMuKQBRAevy4C3AQEBpB4kRU=,aO48gA== a=transform:1.000000,0.000000,0.000000;0.000000,1.000000,0.000000;0.000000,0.000000,1.000000
After reading: http://www.ietf.org/mail-archive/web/avt/current/msg01413.html and discussions internally here I realize it's not this simple. The bug, and fix, is still valid for the o= field but the c field is more complex. It should normally be 0.0.0.0 for unicast (unless the rtp only sends to a single specific client address which doesn't make sense) and the multicast group address+ttl for multicast. So this patch is still correct, since we need to assign server_ip of GstRTSPClientPrivate to the local address of the rtsp server. BUT the sdp should not use this address for the c= line. See rtsp-sdp.c:gst_rtsp_sdp_from_media where server_ip is used directly for creating the c= line without regard to unicast/multicast etc.
This is my suggestion: we change the rtsp-sdp functionality to always write either 0.0.0.0 or :: depending on server_proto. We will need modifications to be able to know already at DESCRIBE whether or not we have multicast or unicast. I believe we need to communicate this through media, since it ultimately depends on the URL in many cases. But that's a different bug/modification that merits more thought.
Created attachment 246628 [details] [review] SDP patch to always set 0.0.0.0 or :: in c= line
commit 3dbe0e17d4c67a26630f9df956a8a84aa2dec268 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Fri Jun 14 16:05:59 2013 +0200 sdp: cleanup sdp info We don't need to pass the proto, we can more easily check a boolean. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702063 commit f9f994e33d47ead1e4fa82591abde3caa363a03d Author: Alexander Schrab <alexas@axis.com> Date: Wed Jun 12 15:22:57 2013 +0200 use 0.0.0.0 or :: for c= line instead of server address commit 275e2d52a4a1a33025509a8da0efa12756ace7e4 Author: Alexander Schrab <alexas@axis.com> Date: Wed Jun 12 10:56:16 2013 +0200 use local address, not remote, in SDP See https://bugzilla.gnome.org/show_bug.cgi?id=702063