<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><blockquote type="cite">I am confused as how the event mechanism works in live555. I have a source that is fed with video and audio frames and I want to trigger doGetNextFrame() of my custom DeviceSource so that those frames are streamed using live555. For this I am using<br><br><br>m_eventID = envir().taskScheduler().createEventTrigger(deliverFrame0);<br>envir().taskScheduler().triggerEvent(m_eventID, this);<br></blockquote><div><br></div>The "this" in the "triggerEvent()" call is wrong, because you should not be calling "triggerEvent()" from within one of your 'DeviceSource' class's member functions. "triggerEvent()" should be called from a *separate thread* - the thread that is doing your encoding. Because this separate thread is not the LIVE555 thread, then "triggerEvent()" is the *only* LIVE555 code that it is allowed to be calling.</div><div><br></div><div><br><blockquote type="cite">void MyStreamingDeviceSource::deliverFrame0(void* clientData)<br>{<br> ((MyStreamingDeviceSource*)clientData)->doGetNextFrame();<br>}<br></blockquote><div><br></div>No, don't do this. "deliverFrame0()" should call "deliverFrame()", as illustrated in the "DeviceSource" code.</div><div><br></div><div><br><blockquote type="cite">But doGe[Next]tFrame is called when I called videoSink->startPlaying() too which is not valid for me as I dont have any data yet to stream.</blockquote><div><br></div>That's OK. When data later *does* become available, then your separate 'encoder' thread will call "triggerEvent()", and then "deliverFrame()" will be called.</div><br><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a></span></span>
</div>
<br></body></html>