<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">There is so much wrong here that I barely know where to begin. But the big mistake in your code is that you are trying to create 'source' and 'sink' objects and start streaming from them yourself, in your own code. This is completely wrong. Our RTSP server implementation (specifically, our "<span style="background-color: rgb(255, 255, 255); ">OnDemandServerMediaSubsession" class, which you are subclassing) </span>does all of this for you (when clients ask to play a stream). All you need to do is define and implement your own subclass of "<span style="background-color: rgb(255, 255, 255); ">OnDemandServerMediaSubsession" (by implementing the "createNewStreamSource()" and "createNewRTPSink()" virtual functions.</span><div><br></div><div>For illustration, I suggest that you look at the code in "liveMedia/AMRAudioFileServerMediaSubsession.cpp". Your "<span style="background-color: rgb(255, 255, 255); ">OnDemandServerMediaSubsessionMarina" class should be just about as simple as this.</span><br><div><br></div><div>In particular:</div><div><br></div><div>1/ The body of your "<span style="background-color: rgb(255, 255, 255); ">OnDemandServerMediaSubsessionMarina" constructor should probably be completely empty. In particular, you should *not* be creating any source or sink (or groupsock) objects here. (Also, because you will be streaming from a live input source, the "reuseFirstSource" parameter that you pass to the base class ("</span><span style="background-color: rgb(255, 255, 255); ">OnDemandServerMediaSubsession") constructor should be True.</span></div></div><div><span style="background-color: rgb(255, 255, 255); "><br></span></div><div><span style="background-color: rgb(255, 255, 255); ">2/ Your "createNewStreamSource()" implementation should create a new "FramedSourceMarina" object, as you do now, but it should then feed it into a new "</span><span style="background-color: rgb(255, 255, 255); ">MPEG4VideoStreamDiscreteFramer" object (note, *not* a "</span><span style="background-color: rgb(255, 255, 255); ">MPEG4VideoStreamFramer"), and you should return that object as the result of the function. (If, instead, you want to stream H.264, then you would create a "H264VideoStreamDiscreteFramer" instead.) You should also set the "estBitrate" result parameter (the stream's estimated bit rate in kbps).</span></div><div><span style="background-color: rgb(255, 255, 255); "><br></span></div><div><span style="background-color: rgb(255, 255, 255); ">3/ Most of your code in "</span><span style="background-color: rgb(255, 255, 255); ">RTPService::RTPService()" and "</span><span style="background-color: rgb(255, 255, 255); ">RTPService::StartStreaming()" is wrong. In particular, you should not be creating *any* source, sink, or groupsock objects here. And you should not be calling "startPlaying()" (or "stopPlaying()) *anywhere* in your code. (Again, our RTSP server implementation does this for you.) The only things that you should be doing here are (in order):</span></div><div><span style="background-color: rgb(255, 255, 255); ">- create a "TaskScheduler" and "UsageEnvironment".</span></div><div><span style="background-color: rgb(255, 255, 255); ">- create a "RTSPServer".</span></div><div><span style="background-color: rgb(255, 255, 255); ">- create a "</span><span style="background-color: rgb(255, 255, 255); ">ServerMediaSession" object.</span></div><div><span style="background-color: rgb(255, 255, 255); ">- create a "</span><span style="background-color: rgb(255, 255, 255); ">OnDemandServerMediaSubsessionMarina" object, and add this to the "ServerMediaSession" object.</span></div><div><span style="background-color: rgb(255, 255, 255); ">- add the "</span><span style="background-color: rgb(255, 255, 255); ">ServerMediaSession" object to the "RTSPServer". (Note: *Do not* create or use a "</span><span style="background-color: rgb(255, 255, 255); ">PassiveServerMediaSubsession" object at all; that's used only for multicast streaming, which you're not doing here.)</span></div><div><span style="background-color: rgb(255, 255, 255); ">- call "</span><span style="background-color: rgb(255, 255, 255); ">doEventLoop()", to enter the LIVE555 event loop.</span></div><div><span style="background-color: rgb(255, 255, 255); "><br></span></div><div><span style="background-color: rgb(255, 255, 255); ">For illustration, I suggest that you look at the code for the "testOnDemandRTSPServer" demo application (see "testProgs/</span>testOnDemandRTSPServer.cpp"), and understand how that works.</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>