<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks Ross,<div>So there is not any way to push data (frame data) into a deivceSource?</div><div><br></div><div>I have modified DeviceSource.cpp deliverFrame to <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">deliverFrame(<span style="color: #aa0d91">void</span> *data, <span style="color: #aa0d91">int</span> len) <span class="Apple-style-span" style="font-family: Helvetica; font-size: 12px; ">to pass data into it. And in the function follows;</span></span></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span><span style="color: #aa0d91">if</span><span style="color: #000000"> (!isCurrentlyAwaitingData()) </span><span style="color: #aa0d91">return</span><span style="color: #000000">; </span>// we're not ready for the data yet</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// Deliver the data here:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>fMaxSize = <span style="color: #1c00cf">1048576</span>;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "><span class="Apple-tab-span" style="white-space:pre">        </span>memcpy(fTo, data, len);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><span style="color: #000000"><span class="Apple-tab-span" style="white-space:pre">        </span>printf(</span>"Frame sent, len=%d\n"<span style="color: #000000">, len);\\lets me know when a frame is accepted</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><font class="Apple-style-span" color="#000000"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// After delivering the data, inform the reader that it is now available:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; "> FramedSource::afterGetting(<span style="color: #aa0d91">this</span>);</div></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div></div><div>The isCurrentlyAwaitingData returns most of the time, meaning only about every 1.3 seconds a frame is accepted.</div><div><br></div><div>My input is defined and used as below;</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "> MPEG4VideoStreamDiscreteFramer<span style="color: #000000">* </span>videoSource<span style="color: #000000">;</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">.</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">.</span></font></div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "> DeviceParameters<span style="color: #000000"> params;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000"><span class="Apple-style-span" style="white-space: pre;"> </span></font>fileSource<span style="color: #000000"> = </span>DeviceSource<span style="color: #000000">::</span><span style="color: #26474b">createNew</span><span style="color: #000000">(*</span>env<span style="color: #000000">, params);</span></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">.</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">.</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><span style="color: #000000"> </span>FramedSource<span style="color: #000000">* videoES = </span>fileSource<span style="color: #000000">;</span></div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"><span class="Apple-style-span" style="color: rgb(63, 110, 116); "><span style="color: #000000"> </span>videoSource<span style="color: #000000"> = </span>MPEG4VideoStreamDiscreteFramer<span style="color: #000000">::</span><span style="color: #26474b">createNew</span><span style="color: #000000">(*</span>env<span style="color: #000000">, videoES);</span></span></p><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; min-height: 14.0px"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(0, 116, 0); "><span style="color: #000000"> </span>// Finally, start playing:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(196, 26, 22); "><span style="color: #000000"> *</span><span style="color: #3f6e74">env</span><span style="color: #000000"> << </span>"Beginning to read from file...\n"<span style="color: #000000">;</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><span style="color: #000000"> </span>videoSink<span style="color: #000000">-></span><span style="color: #26474b">startPlaying</span><span style="color: #000000">(*</span>videoSource<span style="color: #000000">, afterPlaying, </span>videoSink<span style="color: #000000">);</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000">.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000">.</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; color: rgb(63, 110, 116); "><font class="Apple-style-span" color="#000000"><br></font></div></span></font></div></div><div>The rest of the code is based in testMPEG4VideoStreamer.cpp</div><div><br></div><div>Thanks</div><div>Austin</div><div><br></div><div><div><div>On Dec 26, 2008, at 8:38 PM, Ross Finlayson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite">The call to doGetNextFrame (doGetNextFrame(void *data, int len) in my code) only happens when data is present.<br></blockquote><br>No, that's not true! The "doGetNextFrame()" (virtual) function is called by the "FramedSource::getNextFrame()" function, which is called by the downstream object whenever it wants new data. I.e., it's the downstream object that decides when that function gets called.<br><br>-- <br><br>Ross Finlayson<br>Live Networks, Inc.<br><a href="http://www.live555.com/">http://www.live555.com/</a><br>_______________________________________________<br>live-devel mailing list<br>live-devel@lists.live555.com<br>http://lists.live555.com/mailman/listinfo/live-devel<br></div></blockquote></div><br></div></body></html>