[Live-devel] Event Triggerring
Ross Finlayson
finlayson at live555.com
Thu Jul 21 17:12:15 PDT 2011
>I thought in the direction of creating
>a trigger with
>
>EventTriggerId myTrigger = env->taskScheduler().createEventTrigger(myProc);
>
>To launch my routine within the playing process, but as I understand, I
>cannot call
>
>env->taskScheduler().triggerEvent(myTrigger);
>
>within the Event Loop.
Yes, of course you can. But if you're already running within the
event loop, then you don't need to use the event trigger mechanism
(because, if you're running within the event loop, you're already
executing code in response to an event). Instead, you can just call
"myProc()" directly.
> Could you, please, give me a piece of advice how to
>launch myProc() in between promts "Beginning to read from file..." and
>"...done reading from file".
It depends: When specifically do you want to call "myProc()"? If you
want to do it after a certain time has elapsed (or periodically),
then you can do this using "TaskScheduler::scheduleDelayedTask()".
If, however, you want to do this in response to something that's
happening in a separate thread (i.e., one that's *not* running the
LIVE555 event loop), then the event trigger mechanism would be
perfect for this.
--
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list