<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">In our application replicas are being used by RTPSinks, to multiply one source (from encoder) to multiple clients using class derived from OnDemandServerMediaSubsession (we need to support unicast).</div></blockquote><div><br class=""></div>If all of your clients are unicast RTSP clients, all using just one “OnDemandServerMediaSubsession” subclass, then you shouldn’t need to use “StreamReplicator” at all. Instead, just ensure that your “OnDemandServerMediaSubsession” subclass’s constructor sets the “reuseFirstSource” parameter to True when it calls the parent (“OnDemandServerMediaSubsession”) constructor. Setting the “reuseFirstSource” parameter to True will ensure that only one instance of your encoder source (your “FramedSource” subclass) is in existence at any time. (You must still allow for your “FramedSource” subclass to be closed, then later re-opened; however, no more than one object of this class will be in existence at any given time.)</div><div><br class=""></div><div>In this case the ‘replication’ (transmitting packets to the multiple unicast clients) will happen automatically at a lower level, inside the “Groupsock” object.</div><div><br class=""></div><div>(Note, for example, the “testOnDemandRTSPServer” demonstration application (in “testProgs”). If you were to change the definition of the “reuseFirstSource” variable in this code from False to True, then you could stream from the same file source to multiple concurrent unicast clients, with no additional change to the code.)</div><div><br class=""></div><div><br class=""></div><div><blockquote type="cite" class=""><div class="">To summarize: If timeout checks are made independently for each of N replicas there will be 2*N scheduled tasks for each frame (1 made by RTPSink + 1 for timeout check) and N tasks will get canceled (in the normal mode of operation, when timeouts are never reached). If timeout checks are made in bulk like in proposed patch there will be N+1 scheduled tasks and 1 canceled task for each frame.<br class=""></div></blockquote><div><br class=""></div>Why not have your application create just one timeout task, but - when this task is run - have it check all of the N replicas at once?</div><div><br class=""></div><div>In any case, as I noted earlier, the “StreamReplicator” class is the wrong place to be putting ‘timeout’ functionality. It’s better to simply require that the code that reads from each active replica be ‘well-behaved’, and continue reading from each replica - or else use the existing ‘deactivate’ mechanism (either by calling “stopGettingFrames()”, or by closing the replica) - if it no longer wishes to keep reading from it.</div><br class=""><div apple-content-edited="true" class="">
<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 class="">Live Networks, Inc.<br class=""><a href="http://www.live555.com/" class="">http://www.live555.com/</a></span></span>
</div>
<br class=""></body></html>