[Live-devel] ] isCurrentlyAwaitingData
Weber, Patrick
Patrick.Weber at iecinfrared.com
Thu Feb 7 13:14:36 PST 2019
When determining if you should deliver a frame, you need to check if Live555 is waiting for one. Something like this in your FramedSource subclass:
//====================================================================
// Deliver a frame from the RTSPSource object.
//====================================================================
void CameraFramedSource::DeliverFrame ()
{
byte *frameData;
unsigned frameSize;
if (isCurrentlyAwaitingData ())
{
if (_encodedSource->GetFrame (&frameData, &frameSize, &_ulLastFrameSent))
{
try
{
if (frameSize > 0 && frameData != nullptr)
{
if (frameSize > fMaxSize)
{
fFrameSize = fMaxSize;
fNumTruncatedBytes = frameSize - fMaxSize;
}
else
{
fFrameSize = frameSize;
fNumTruncatedBytes = 0;
}
SetPresentationTime (_ulLastFrameSent);
if (SafeMemCopy (fTo, frameData, frameSize))
FramedSource::afterGetting (this);
}
_encodedSource->ReleaseFrame ();
++_ulFramesDelivered;
}
catch (...) { }
}
}
}
More information about the live-devel
mailing list