[Live-devel] 答复: 答复: empty payload data will be sent in MultiFramedRTPSink
Zhang Qian(张倩)
qianzhang at asrmicro.com
Mon Sep 23 23:25:19 PDT 2019
Hi Ross,
Yes, EventTrigger can fix this issue.
Refer to DeviceSource.cpp in live555 source code. I call "doGetNextFrame"(will copy buffer to fTo and call FramedSource::afterGetting) in event trigger func "deliverFrame" when frame is available. It can work. Thank you. :)
void DeviceSource::deliverFrame0(void* clientData) {
((DeviceSource*)clientData)->doGetNextFrame();
}
Thanks.
/Qian
-----邮件原件-----
发件人: live-devel [mailto:live-devel-bounces at us.live555.com] 代表 Ross Finlayson
发送时间: 2019年9月24日 12:27
收件人: LIVE555 Streaming Media - development & use
主题: Re: [Live-devel] 答复: empty payload data will be sent in MultiFramedRTPSink
> 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/
_______________________________________________
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