[Live-devel] Event Triggerring

Sergey G. Kosov sergey.kosov at project-10.de
Sat Jul 23 08:50:56 PDT 2011


Hi Ross,

Thanks for the advice. I have created a new Thread and call the 

env->taskScheduler().triggerEvent(myTrigger);

function from there. It works fine. And I would like to ask if it is
possible to detect when the client connects to the server.
Actually I want to implement 2 features:
1. To start playing the file when the first client connects. In order to do
that I think to catch somehow the event of the clients connection and then
call:  outputSink->startPlaying(*videoSource, afterPlaying, outputSink);
2. To change the speed of the video playing, when the client connects. For
this purpose I introduced a positive floating point coefficient in the
Parser() for scaling the video play without indexing.

Could you please, give me a hint how to detect the clients connections /
disconnection. I looked through all the test applications but haven't found
any relative information to this question.

Thanks in Advance, 

Sergey.

-----Original Message-----
From: live-devel-bounces at ns.live555.com
[mailto:live-devel-bounces at ns.live555.com] On Behalf Of Ross Finlayson
Sent: Friday, July 22, 2011 2:12 AM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Event Triggerring

>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/
_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel



More information about the live-devel mailing list