<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 12, 2014, at 12:31 PM, Ross Finlayson <<a href="mailto:finlayson@live555.com" class="">finlayson@live555.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; 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;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">I’ve got this working along the lines you’ve described, but the problem I’m running into is a need for some kind of external (to live555 thread) reference to each RTSPClient, in order to trigger other events (stopping one, for example). That’s why I thought about creating the clients outside of the loop, but I can understand why that’s not a good idea. Creating the RTSPClient instance inside the eventTrigger handler doesn’t provide a way to pass a reference back, either (as far as I can tell).</div><div class=""><br class=""></div><div class="">Do you have any recommendation on how to give the main application thread a useful reference to each stream for use with later event triggers? It seems to me that this would be a common desire for an app that handles multiple streams.</div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; 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;" class=""><br class=""></div><span style="font-family: Helvetica; font-size: 12px; 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; float: none; display: inline !important;" class="">I suggest creating - in the external thread - some object (struct) that represents the stream. This struct could contain some fields (such as the RTSP URL) that would be set by the external thread, and other LIVE555-specific fields (such as a pointer to a “RTSPClient” object) that would be set and accessed only by the LIVE555-event-loop thread.</span></div><div class=""><br class=""></div><div class="">Then, pass a pointer to this struct (rather than just the RTSP URL) as the ‘clientData’ parameter to “triggerEvent()”.</div></div></div></blockquote></div><br class=""><div class="">OK, so the “addNewStream” triggered event, where the RTSPClient is created, would add the pointer to it then. I’m a bit concerned about thread-safety here, since the struct is created on the GUI thread, then manipulated on the live555 thread. I suppose you’re implying that safety would come from being careful about each field only being set from the appropriate thread.</div><div class=""><br class=""></div><div class="">-e</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>