[Live-devel] Run a method when streaming starts for another client?

Usama Shah usama.shah at gorillabox.net
Thu Aug 13 05:16:29 PDT 2015


I need to send some extra data `sendIframes` when a new client connects to
our RTSP server. This is what I have found and done so far

    env->taskScheduler().scheduleDelayedTask(5000000,
(TaskFunc*)sendIframes, NULL); //failed
    //delaying is useless as we need to send only to the new client connects

    EventTriggerId eId =
env->taskScheduler().createEventTrigger((TaskFunc*)sendIframes);
    env->taskScheduler().triggerEvent(eId,NULL);//failed
    //how do we trigger it when new client connects or when streaming
starts for the new client?

    env->taskScheduler().setBackgroundHandling(0,
SOCKET_READABLE|SOCKET_WRITABLE,(TaskScheduler::BackgroundHandlerProc*)&sendIframes,NULL);//how
to use this?
    //this looks like the right way to do what we want but how exactly?

    env->taskScheduler().doEventLoop(); // does not return

`doEventLoop()` handles new connections and send stream to the new clients
all be itself.

At the moment only thing I can think of is to edit the source code of
Live555.

    void StreamState::startPlaying(Destinations* dests, unsigned
clientSessionId,
           TaskFunc* rtcpRRHandler, void* rtcpRRHandlerClientData,
           ServerRequestAlternativeByteHandler*
serverRequestAlternativeByteHandler,
           void* serverRequestAlternativeByteHandlerClientData) {
    //.....
    //run sendIframes();
    //.....
    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20150813/e4841c1c/attachment.html>


More information about the live-devel mailing list