GNOME Bugzilla – Bug 545710
[rtspsrc] : create rtp/rtcp socket pair + same port for different tracks problem
Last modified: 2008-08-22 16:05:06 UTC
Here is a patch to enhance rtp/rtcp socket pair. Before : the RTP port was always the result of an anonymous bind. if RTP port + 1 was busy, rtspsrc creation fails. After : the first RTP port is an anonymous bind. if not even, try RTP + 1 and whil it fails try RTP + 2 when ok, set RTCP to RTP+1. if it fails, go again with RTP+1 But, There might be a problem. (in fact there is in my application). udpsrc sets the flag SO_REUSEADDR, so RTP/RTCP ports for tw different RTSP tracks may be the same. It seems a bit confusing for rtpbin following. Here is a .dot and .log file to illustrate. rtsp stream contains audio AMR (pt=97) and video H263 (pt=96) Both streams goes to same rtpssrcdemux, then different jitterbuffer and rtpdemux. This could be ok if caps (except pt) whene not the same on both streams Is this method for allocating RTP pair a mistake ? Should we set a "no_reuse" property on udpsrc to be use in rtspsrc ?
Created attachment 115628 [details] [review] socket pair creation enhancement
Created attachment 115630 [details] dot of problem shooting pipeline
Created attachment 115631 [details] Log file associated
Patch by: Aurelien Grimaud <gstelzz at yahoo dot fr> * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_alloc_udp_ports): Improve udp port setup. Fixes #545710.