[Live-devel] Live555 Streaming from a live source

Sagi Ben Moshe sagi at netvision.net.il
Thu Jul 8 23:24:03 PDT 2010


Hi Ross, 

We are setting fFrameSize to the size of the frame before the posted code. 
I am familiar with fNumTruncatedBytes but as you say the data will be
dropped. We do not want this to happen. 

I did not sure I understand your last statement "make sure that your
downstream object always has enough buffer space to avoid trunction - i.e.,
so that fMaxSize is always >= fFrameSize".  How can I assure it, the Live555
library request 150,000 bytes exactly. We give it frame by frame and on the
last frame it is not the exact number so we are in the situation of fMaxSize
< fFrameSize. 

If I understand you correctly we have two options 

1. Feeding Live555 frame by frame and on the last frame truncate the frame
and loss the data 
2. Handle internal buffer inside our DeviceSource in order to give Live555
parts of a frame on the last frame. It means that Live555 will handle the
recognition of Frames and on this scenario I do not understand what should
be the fPresentationTime because we are sending only part of a frame to the
Live555 library and on the next call we will send the following part of the
frame.  

What is the preferred way of action?   


Thanks,
Sagi

-----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 09, 2010 8:45 AM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Live555 Streaming from a live source

>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::afte
rGetting,
>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
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel



More information about the live-devel mailing list