[Live-devel] Event loop problems

Matthew Hodgson matthew at mxtelecom.com
Tue May 16 18:28:44 PDT 2006


Hi all,

I'm running the BasicUsageEnvironment in a single thread of an test jig 
for experimenting with integrating live555 with a variety of higher level 
signalling stacks.  I understand that the thread should always be running 
its scheduler's event loop (with env->taskScheduler().doEventLoop(); or 
similar).

My problem is: by default the event loop appears to be blocked 
indefinitely on select()ing on any filehandles that live555 is listening 
on.  If no media transferring is going on, then the thread blocks forever 
in this select().  How do I tell the event loop to break out into a 
callback so that I can set up sinks and sources when I need to 
send/receive RTP?

Currently I'm working around this in the way that VLC does, by scheduling 
an interrupt event every 300ms, which forces doEventLoop() to exit and 
allows for sources and sinks to be setup (if needed) before restarting the 
event loop.  This doesn't seem very elegant though - i'm effectively 
polling for instructions to set up new RTP streams every 300ms, which 
seems arbitrary and not exactly fast.

Is there any way to somehow unwedge live555's event loop so that it 
executes callbacks, other than having it receive RTP?  Is the standard 
practice to add an additional readfd to its scheduler's select(), and prod 
it from a different thread/application via select() when you need it to 
run callbacks?  If so, is there an obvious way of doing this short of 
subclassing my own UsageEnvironment and TaskScheduler?

many thanks in advance :)

Matthew.


More information about the live-devel mailing list