GNOME Bugzilla – Bug 319183
rtspsrc filter sometimes uses an odd port for rtp
Last modified: 2006-02-16 10:46:14 UTC
The rtp and rtcp ports used in the rtspsrc filter are read from udpsrc elements after setting them to the PAUSED state. The result is that sometimes, the RTP port is odd. RFC3550 states that the RTP port SHOULD be even while the RTCP port SHOULD be the next higher (odd) port number. Apple's Darwin Streaming server returns an error if the RTP port is odd: request message 0xbfffe8f0 request line: method: 'SETUP' uri: 'rtsp://172.16.133.135:7070/Incredibles.3gp/trackID=3' headers: key: 'Transport', value: 'RTP/AVP/UDP;unicast;client_port=32835-32837,RTP/AVP/UDP;multicast,RTP/AVP/TCP' body: response message 0xbfffe8d0 status line: code: '400' reason: 'Bad Request' headers: key: 'CSeq', value: '2' key: 'Connection', value: 'Close' key: 'Server', value: 'DSS/5.5 (Build/489.7; Platform/Linux; Release/Darwin; )' body:
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_get_type), (gst_rtspsrc_class_init), (gst_rtspsrc_set_property), (gst_rtspsrc_get_property), (gst_rtspsrc_stream_setup_rtp): * gst/rtsp/gstrtspsrc.h: Make sure the RTP port is an even port an try to allocate another if not. Added retry property to control max retries for port allocation. Make sure RTCP port is RTP port+1. Cleanup when port allocation fails. Fixes #319183.