[Live-devel] 答复: empty payload data will be sent in MultiFramedRTPSink
Ross Finlayson
finlayson at live555.com
Mon Sep 23 21:27:12 PDT 2019
> On Sep 23, 2019, at 9:15 PM, Zhang Qian(张倩) <qianzhang at asrmicro.com> wrote:
>
> Hi Ross,
>
> Thanks for your reply. Do you mean I just call scheduleDelayedTask if (fFrameSize > 0) as below ? Seems that it will block the live555 thread...
>
> if (fFrameSize > 0)
> {
> // Set the 'presentation time':
> gettimeofday(&fPresentationTime, NULL);
> fDurationInMicroseconds = (mCurrentTimeStampUs - mLastTimeStampUs);
> nextTask() = envir().taskScheduler().scheduleDelayedTask(schedule_delayUs,
> (TaskFunc*)FramedSource::afterGetting, this);
> }
> return;
Yes, this should work. Of course, in the case where “fFrameSize == 0”, you must arrange for this code to be called again later, when a (non-empty) frame becomes available. In other words, you need to handle an ‘event’ when a new frame becomes available. Remember that LIVE555-based applications are event-based, using an event loop.
If you haven’t already done so, please read
http://live555.com/liveMedia/faq.html#other-kinds-of-event
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list