<div>I rewrite the testOnDemandRTSPServer.cpp as follows.</div>
<div> </div>
<div>The testOnDemandRTSPServer.CPP will produce two URLs, each URL include a m4v video separately.</div>
<div> </div>
<div>I use the Ethereal tools to analyze the packet.</div>
<div> </div>
<div>According to the Ethereal analytical result, each URL has a pair port is the RTP port and RTCP port.</div>
<div> </div>
<div>So this RTSP server will have two each RTP ports, two each RTCP ports and a RTSP port.</div>
<div> </div>
<div>Do these two URLs have the way to use a pair port( one RTP port and one RTCP port ) together ?</div>
<div> </div>Ignoring the RTSP contain a few URLs, I hope the RTSP server only uses one RTSP port, one RTP, and one RTCP port.
<div> </div>
<div>*****************************************************************************************************</div>
<div>
<p>int main(int argc, char** argv) <br>{ <br> // Begin by setting up our usage environment:<br> TaskScheduler* scheduler = BasicTaskScheduler::createNew();<br> env = BasicUsageEnvironment::createNew(*scheduler);</p>
<p> // Create the RTSP server:<br> RTSPServer* rtspServer = RTSPServer::createNew(*env, 8554, NULL, 45);<br> if (rtspServer == NULL) <br> {<br> *env << "Failed to create RTSP server: " << env->getResultMsg() << "\n";
<br> exit(1); <br> }</p>
<p> char const* descriptionString = "Session streamed by \"testOnDemandRTSPServer\"";</p>
<p> // 1: A MPEG-4 video elementary stream:<br> {<br> char const* streamName = "Video01";<br> char const* inputFileName = "test1.m4v";<br> ServerMediaSession* sms<br> = ServerMediaSession::createNew(*env, streamName, streamName,
<br> descriptionString);</p>
<p> sms->addSubsession(MPEG4VideoFileServerMediaSubsession<br> ::createNew(*env, inputFileName, reuseFirstSource));</p>
<p> rtspServer->addServerMediaSession(sms);<br> }</p>
<p> // 2: A MPEG-4 video elementary stream:<br> {<br> char const* streamName = "Video02";<br> char const* inputFileName = "test2.m4v";<br> ServerMediaSession* sms<br> = ServerMediaSession::createNew(*env, streamName, streamName,
<br> descriptionString);</p>
<p> sms->addSubsession(MPEG4VideoFileServerMediaSubsession<br> ::createNew(*env, inputFileName, reuseFirstSource));</p>
<p> rtspServer->addServerMediaSession(sms);<br> }</p>
<p> env->taskScheduler().doEventLoop(); <br> <br> return 0;<br>}</p></div>