[Live-devel] how to schedule function using scheduleDelayedTask()

Ashwani Kathuria ashwani.grps at gmail.com
Thu Jul 7 21:13:37 PDT 2011


It's true that MultiFramedRTPSink class already provide this feature of
adding delay. But what we wanted was the optimization over that.

With MultiFramedRTPSink::sendPacketIfNecessary function delay was added
before sending packet over the network.
As we are working on live(real time) transmission so what we want is:
- send the data (media frames) over network as soon as they are available.
However scheduleDelayedTask in
MultiFramedRTPSink::sendPacketIfNecessary prevents this unless
fDurationInMicroseconds = 0
- After sending frame we want RTP to check for new frame (in shared buffer)
only when it is expected (else wait in delay queue) i.e. after
fDurationInMicroseconds. So we want to shift that scheduleDelayedTask from
"sendPacketIfNecessary" to "packFrame"
Hence optimization suggested is:
Shift the scheduleDelayedTask from "sendPacketIfNecessary" to "packFrame"
with taskFunction set to GetNextFrame().

With this optimization packets will reach earlier at peer by
fDurationInMicroseconds.

Regards,
Ashwani Kathuria
On Thu, Jul 7, 2011 at 10:19 PM, Ross Finlayson <finlayson at live555.com>wrote:

> **
>
> I did some modification in code for live streaming. Now I want the
> getNextFrame to be scheduled with a delay (of frame duration).
>
> So in function,* MultiFramedRTPSink::packFrame()*
>
> What modifications I should do in code in order to call
>
> *fSource->getNextFrame function()*
>
> using
>
> *envir().taskScheduler().scheduleDelayedTask()*
>
>
> Why do you think that you need to modify the supplied library code?  You
> don't modify the code of other source code libraries that you use (e.g.,
> "libc"), do you?
>
> (This is explained in the FAQ, which also explains why serious
> professionals do not use "@gmail.com" email addresses :-)
>
> The duration between each outgoing frame is determined by the value of
> "fDurationInMicroseconds" that you set in whatever upstream object gets fed
> to your "MultiFramedRTPSink" subclass.  (The "MultiFramedRTPSink" class (as
> is!) then works out the appropriate delay between each outgoing frame.)
> **
>
> --
>
> **
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20110708/554da7ff/attachment-0001.html>


More information about the live-devel mailing list