After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702063 - SDP response includes remote address where the local should be
SDP response includes remote address where the local should be
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
1.x
Other Linux
: Normal normal
: 1.2.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-12 09:05 UTC by Alexander Schrab
Modified: 2014-02-25 22:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (827 bytes, patch)
2013-06-12 09:05 UTC, Alexander Schrab
none Details | Review
SDP patch to always set 0.0.0.0 or :: in c= line (1.32 KB, patch)
2013-06-12 13:24 UTC, Alexander Schrab
none Details | Review

Description Alexander Schrab 2013-06-12 09:05:28 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
Comment 1 Alexander Schrab 2013-06-12 09:45:22 UTC
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.
Comment 2 Alexander Schrab 2013-06-12 11:51:52 UTC
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.
Comment 3 Alexander Schrab 2013-06-12 13:24:33 UTC
Created attachment 246628 [details] [review]
SDP patch to always set 0.0.0.0 or :: in c= line
Comment 4 Wim Taymans 2013-06-14 14:07:30 UTC
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