<html><head><base href="x-msg://208/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; 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; "><div lang="ZH-CN" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 24pt; margin-bottom: 0.0001pt; font-size: 12pt; font-family: ËÎÌå; "><span lang="EN-US" style="font-size: 10.5pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">Thanks for your reply. Now, I can play multiple streams concurrently after I take the testRTSPClient program as an example. But this works OK when I provide all URLs at one time and then call the doEventLoop(). How can I make it work so that I can play another stream after other streams have arlready started but haven¡¯t stoped playing (with one thread control not using threads)?</span></div></div></div></span></blockquote><div><br></div></div><div>First, the easiest way to do this is to run each RTSP client in a separate *process* (i.e., in a separate application, *not* as a separate thread within a single application). If you do not need to share memory between the stream receivers, then this is the simplest solution.</div><div><br></div><div>The rest of this message, however, assumes that - for whatever reason - you want all of your stream receivers to run in the same application (i.e., process).</div><div><br></div>How to start playing another stream? This depends - What decides when a new stream should be played? Whatever this is, it will need to be handled as an "event", within the event loop.<div><br></div><div>Perhaps, for example, you have a GUI - running in a different thread - where the user indicates (perhaps by filling in a form and clicking a button) that a new stream should be started. In this case, you could use the "EventTrigger" mechanism that's defined for the "TaskScheduler" class: See</div><div><span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://www.live555.com/liveMedia/faq.html#other-kinds-of-event">http://www.live555.com/liveMedia/faq.html#other-kinds-of-event</a></div><div><br></div><div>Or perhaps you have a TCP socket connected to a console that the user is using to type commands (e.g. "start-playing <rtsp-url>"). In this case, this 'command-line user interface' TCP socket could be read and parsed from within the event loop - using a handler that's set up using the "TaskScheduler:turnOnBackgroundReadHandling()" routine.</div><div><br></div><div>But whatever you do, the 'event' that determines that a new stream needs to be played is an 'event' that will need to be handled within the event loop.</div><div><br></div><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>