<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite"><div style="font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">However,<br>when the client initially connects there is a somewhat strange sequence of calls. First there are the<br>expected calls:<br><br>createNewStreamSource()<br>createNewRTPSink()<br><br>to my OnDemandServerMediaSubsession subclass. These set up a JPEGVideoSource subclass<br>and a standard JPEGVideoRTPSink. Immediately after this the destructor for my JPEGVideoSource<span class="Apple-converted-space"> </span><br>is called and the source is cleaned up. After this I again get:<br><br>createNewStreamSource()<br>createNewRTPSink()<br><br>and now the streaming starts and never stops. Is it possible to enable some kind of debugging<span class="Apple-converted-space"> </span><br>output for Live555?</div></blockquote><div><br></div>You don't need 'debugging', because in this case I can tell you exactly what is happening.</div><div><br></div><div>"createNewStreamSource()"+"createNewRTPSink()" is called the first time to create a frame source object and a 'dummy' RTP sink object, so that the server can figure out the stream's SDP description. (This is the code "OnDemandServerMediaSubsession::sdpLines()".) Then, the server code closes these source and sink objects. This is when your source class's destructor gets called the first time.</div><div><br></div><div>Then, later - when the first RTSP client connects - "createNewStreamSource()"+"createNewRTPSink()" will get called again. If you have set "reuseFirstSource" to True, then these will not get called again, until all clients have disconnected. At this time, your source class's destructor will get called again, and then later - when another RTSP client connects - "createNewStreamSource()"+"createNewRTPSink()" will get called once more. Etc.</div><div><br></div><div>The bottom line is that your 'frame source' class must allow for the possibility of the object being destroyed, then recreated - perhaps several times. However, if you have set "reuseFirstSource" to True, then there will never be more than one of these objects created concurrently. I.e., the sequence will always be "constructor", "destructor", "constructor", "destructor" ..., never "constructor", "constructor".</div><div><br></div><div>When the last RTSP client disconnects, then your 'frame source' class destructor *will* get called. (If the RTSP client did a "TEARDOWN", then your destructor will get called then. If the RTSP client disappears without doing a "TEARDOWN", then the client connection will get timed out - and your destructor will get called - 65 seconds later (assuming that you didn't change the server's "reclamationTestSeconds" parameter).)</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; "><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; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>