[Live-devel] Adding streams to already-running event loop

Ross Finlayson finlayson at live555.com
Wed Nov 12 12:31:04 PST 2014


> 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).
> 
> 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.

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.

Then, pass a pointer to this struct (rather than just the RTSP URL) as the ‘clientData’ parameter to “triggerEvent()”.

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20141112/092c3ed8/attachment.html>


More information about the live-devel mailing list