[Live-devel] Event Triggerring

Ross Finlayson finlayson at live555.com
Sat Jul 23 12:03:34 PDT 2011


>And I would like to ask if it is
>possible to detect when the client connects to the server.

Of course.  This is what a server does.


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

Our code (the "OnDemandServerMediaSubsession" class) does this 
automatically.  You *do not* need to do this yourself.  All you need 
to do is:
Define and implement your own subclass of 
"OnDemandServerMediaSubsession" that reimplements the two virtual 
functions "createNewStreamSource()" and "createNewRTPSink()".  I 
suggest that you look at the many existing examples of these 
functions in our code (along with the "testOnDemandRTSPServer" code, 
which creates and installs "ServerMediaSession" and 
"ServerMediaSubsession" objecs into a server), as a model.

Also, for more information, see 
http://www.live555.com/liveMedia/faq.html#liveInput-unicast


>2. To change the speed of the video playing, when the client connects.

The easiest place to do this is in your implementation of the 
"createNewStreamSource()" virtual function.  I.e., when you create 
your input source object, you could pass an appropriate 'speed' 
parameter.

To summarize (in case it's not already clear): Our server 
architecture makes it possible for you to develop your own server - 
using your own input source(s) - simply by writing new subclasses (of 
"OnDemandServerMediaSubsession", and, in rare cases, "RTSPServer"). 
You do not need to modify the supplied code to do this.
-- 

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


More information about the live-devel mailing list