Problem about rtp and rtcp ports allocation

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem about rtp and rtcp ports allocation

Demon Deng
rtspsrc and rtsp-server allocate two udp ports for rtp, the even for rtp,  the odd for rtcp.
The allocation in gstreamer works well for only one stream, but fails for more than two streams when the first auto allocated port is odd.

We assume the first auto allocated port is 5001.
For the first stream, we will try 5002 and get 5002/5003 for rtp/rtcp successfully.
For the second stream, we get auto allocated port 5001 again!!
Then we will try 5002 for rtp again.
Finally, we get 5002/5003 for rtp/rtcp of the second stream successfully again, which are the same as the fisrt stream.
This will make rtp not working.

We can allocate the same ports for both stream, because the udpsrc using SO_REUSEADDR.
Is there any good reason for using SO_REUSEADDR in udpsrc? 
We can avoid the problem by setting SO_REUSEADDR to 0.
Or.. is there any other way to solve this problem?

Thanks.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel