We are trying to stream from a live source with Live555.
We implement our own DeviceSource class. In this class we implement doGetNextFrame in the following (logic) way. We remove all the unnecessary implementation details so you can see the idea

If no frame is available do the following

nextTask() = envir().taskScheduler().scheduleDelayedTask(30000,(TaskFunc*)nextTime, this);
If a frame is available do the following

If (fFrameSize < fMaxSize)

This should be "<=", not "<".

Also, I hope you are setting "fFrameSize" properly before you get to this "if" statement.

{
memcpy(fTo, Buffer_getUserPtr(hEncBuf) ,fFrameSize); // copy the frame to Live555 nextTask() = envir().taskScheduler().scheduleDelayedTask(0,(TaskFunc*)FramedSource::afterGetting, this);

You can probably replace this last statement with:
        FramedSource::afterGetting(this);
which is more efficient (and will avoid infinite recursion, because you're reading from a live source).

}
else
{
What should we do? (We do not understand what should we do in this option)

Something like this:
        fNumTruncatedBytes = fFrameSize - fMaxSize;
        fFrameSize = fMaxSize;
        FramedSource::afterGetting(this);

Note, however, that if data gets truncated, then it is *dropped*. This means that you should make sure that your downstream object always has enough buffer space to avoid trunction - i.e., so that fMaxSize is always >= fFrameSize
--

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to