<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">(First, note that if you are receiving the mailing list as a ‘digest’, you should fix the “Subject:” line of your emails when you compose a reply.)<div class=""><br class=""></div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Why are you delaying the call to "FramedSource::afterGetting(this)" by 50 ms?</blockquote></blockquote><blockquote type="cite" class=""><br class=""></blockquote><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class="">But why not?<br class=""></div></blockquote><div><br class=""></div>Because it’s putting the delay in the wrong place - i.e., after the data has been delivered to the downstream object, but before a RTP packet has been sent. In other words, you’re unnecessarily delaying the sending of the first (and subsequent) RTP packets.</div><div><br class=""></div><div>If you want to introduce a delay between sending RTP packets, then the right way to do this is to set the “fDurationInMicroseconds” member variable when you deliver the frame data. This will cause the RTP packet to get sent immediately, but will delay the subsequent call to “doGetNextFrame()” (to request the next frame of data).</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">If, e.g., my source has a 1fps frame rate, why not wait 900ms avoid a busy-wait?<br class=""></div></blockquote><div><br class=""></div>If your source has a 1 fps frame rate, then you *may* set “fDurationInMicroseconds” to 1000000 (i.e., 1 million) each time you deliver a frame’s data (i.e., each time you copy data to the pointer pointed to by “fTo”). *Then*, you notify the downstream object that the frame delivery has been done, by calling</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>FramedSource::afterGetting(this);</div><div>i.e., without any delay.</div><div><br class=""></div><div>However, because you are streaming from a ‘live’ source, you don’t really need to set “fDurationInMicroseconds” at all (in which case it will be left at its default value of 0). But your use of the term “busy-wait” suggests that you are thinking about this code wrong - i.e., you think that you need to periodically ‘poll’ your encoder for data. This is wrong. LIVE555-based applications are event driven. The right way to get data from an external encoder is to make the arrival of data an asynchronous ‘event’ - either by reading from a socket (if the encoder is an open file or pipe), or by encapsulating your encoder in a separate thread that calls “triggerEvent()” (the only LIVE555 function that can be called from an external thread) when new encoded data becomes available. I suggest that you read “liveMedia/DeviceSource.cpp” once again - noting in particular the comments in that file.</div></div><br class=""><br class=""><div apple-content-edited="true" class="">
<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; "><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; ">Ross Finlayson<br class="">Live Networks, Inc.<br class=""><a href="http://www.live555.com/" class="">http://www.live555.com/</a></span></span>
</div>
<br class=""></body></html>