[Live-devel] Streaming from a device

Matt Schuckmann matt at schuckmannacres.com
Fri Sep 11 08:36:41 PDT 2009


Doesn't the watchVariable solution generally require you to setup some 
sort of scheduled periodic event scheduleDelayedTask so that the event 
loop is guarantied to wake up and check it every so often?

For consuming data from a separate thread I've always preferred skipping 
the watch variable and just scheduling a periodic task (every 10 msec or 
so) to check a queue (a thread safe queue) to check for data from the 
producer thread.

Matt S.

Ross Finlayson wrote:
>> The card does not have a sockets interface.
>
> OK, in this case I suggest using the "watchVariable" parameter to 
> "doEventLoop()".  Have a separate thread that reads data from your 
> interface, and then - when sufficient data is available for a frame - 
> sets the "watchVariable" to some value non-zero.  (This should be this 
> second thread's *only* interaction with the "LIVE555 Streaming Media" 
> library.)
>
> In your code, call "doEventLoop()" in a loop - e.g.,
>
> char watchVariable;
> while(1) {
>     watchVariable = 0;
>     scheduler->doEventLoop(&watchVariable);
>     // If we get to this point, then we know that your separate thread 
> has set "watchVariable" to a non-zero value
>     // Call the appropriate function to handle the arrival of new data 
> (e.g., "deliverFrame()")
> };


More information about the live-devel mailing list