Hi,<div><br></div><div>I have been trying to use Live555 to stream a JPEG file to OpenRTSP and other Live555 based clients.</div><div><br></div><div>Depending on the source JPEG file I get varying results in quality. When streaming the JPEG file I am simply finding the SOS marker and copying this to fTo, the code is below. I am starting to think that I need to be something else here as at the client side, for example OpenRTSP, isn't the exact same image.</div>
<div><br></div><div>For example, if I connect to an IP camera, streaming MJPEG, with OpenRTSP I can get an image saved as a JPEG using:</div><div><br></div><div>./openRTSP -m rtsp://....</div><div><br></div><div>I then use this same image with the code below and use openRTSP again to stream the image and I get something far blockier. </div>
<div><br></div><div>Where am I going wrong?</div><div><br></div><div>Thanks in advance</div><div>Andy</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>* <span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>::createNew(UsageEnvironment& <span style="color: rgb(85, 129, 135); ">env</span>,<span style="color: rgb(181, 25, 161); ">const</span> <span style="color: rgb(181, 25, 161); ">char</span> * fileName, <span style="color: rgb(181, 25, 161); ">unsigned</span> <span style="color: rgb(181, 25, 161); ">int</span> timePerFrame)</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>FILE * fid = fopen( fileName, <span style="color: rgb(201, 39, 34); ">"r"</span> );</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">if</span> ( fid == <span style="color: rgb(181, 25, 161); ">NULL</span> )</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(201, 39, 34); ">
<span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">                </span></span><span style="color: rgb(85, 129, 135); ">env</span><span style="color: rgb(0, 0, 0); ">.setResultErrMsg( </span>"Failed to open input device file"<span style="color: rgb(0, 0, 0); "> );</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(181, 25, 161); "><span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">                </span></span>return<span style="color: rgb(0, 0, 0); "> </span>NULL<span style="color: rgb(0, 0, 0); ">;</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">return</span> <span style="color: rgb(181, 25, 161); ">new</span> <span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>( <span style="color: rgb(85, 129, 135); ">env</span>, fid, timePerFrame );</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>::<span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>(UsageEnvironment& <span style="color: rgb(85, 129, 135); ">env</span>, FILE* fid,<span style="color: rgb(181, 25, 161); ">unsigned</span> <span style="color: rgb(181, 25, 161); ">int</span> timePerFrame) </p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>: JPEGVideoSource(<span style="color: rgb(85, 129, 135); ">env</span>), fFid(fid), fTimePerFrame(timePerFrame), fNeedAFrame(False)</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(181, 25, 161); ">
<span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">        </span></span>this<span style="color: rgb(0, 0, 0); ">-></span><span style="color: rgb(85, 129, 135); ">buffer</span><span style="color: rgb(0, 0, 0); "> = </span>NULL<span style="color: rgb(0, 0, 0); ">;</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>fseek( fid, <span style="color: rgb(56, 13, 214); ">0L</span>, SEEK_END );</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>size_t sz = ftell( fFid );</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>fseek( fid, <span style="color: rgb(56, 13, 214); ">0L</span>, SEEK_SET );</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>buffer = <span style="color: rgb(181, 25, 161); ">new</span> <span style="color: rgb(181, 25, 161); ">unsigned</span> <span style="color: rgb(181, 25, 161); ">char</span>[ sz ];</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>fread( buffer, <span style="color: rgb(56, 13, 214); ">1</span>, sz, fid );</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">bool</span> sof0 = <span style="color: rgb(181, 25, 161); ">false</span>;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">bool</span> sos = <span style="color: rgb(181, 25, 161); ">false</span>;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(85, 129, 135); "><span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">        </span></span><span style="color: rgb(181, 25, 161); ">this</span><span style="color: rgb(0, 0, 0); ">-></span>sosIndex<span style="color: rgb(0, 0, 0); "> = </span><span style="color: rgb(56, 13, 214); ">0</span><span style="color: rgb(0, 0, 0); ">;</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">sosSize</span> = <span style="color: rgb(56, 13, 214); ">0</span>;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">for</span> ( <span style="color: rgb(181, 25, 161); ">int</span> i = <span style="color: rgb(56, 13, 214); ">0</span>; i < (<span style="color: rgb(181, 25, 161); ">int</span>)(sz - <span style="color: rgb(56, 13, 214); ">8</span>); ++i )</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span><span style="color: rgb(181, 25, 161); ">if</span> ( buffer[i] == <span style="color: rgb(56, 13, 214); ">0xFF</span> && buffer[i+<span style="color: rgb(56, 13, 214); ">1</span>] == <span style="color: rgb(56, 13, 214); ">0xC0</span>)</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">                </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                        </span>fLastHeight = (buffer[i+<span style="color: rgb(56, 13, 214); ">5</span>]<<<span style="color: rgb(56, 13, 214); ">5</span>)|(buffer[i+<span style="color: rgb(56, 13, 214); ">6</span>]>><span style="color: rgb(56, 13, 214); ">3</span>);</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">                        </span>fLastWidth = (buffer[i+<span style="color: rgb(56, 13, 214); ">7</span>]<<<span style="color: rgb(56, 13, 214); ">5</span>)|(buffer[i+<span style="color: rgb(56, 13, 214); ">8</span>]>><span style="color: rgb(56, 13, 214); ">3</span>);</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">                        </span><span style="color: rgb(181, 25, 161); ">if</span> ( sos && sof0 ) <span style="color: rgb(181, 25, 161); ">break</span>;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">                </span>}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span><span style="color: rgb(181, 25, 161); ">else</span> <span style="color: rgb(181, 25, 161); ">if</span> ( buffer[i] == <span style="color: rgb(56, 13, 214); ">0xFF</span> && buffer[i+<span style="color: rgb(56, 13, 214); ">1</span>] == <span style="color: rgb(56, 13, 214); ">0xDA</span> )</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">                </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                        </span>sosIndex = i + <span style="color: rgb(56, 13, 214); ">2</span>;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                        </span><span style="color: rgb(181, 25, 161); ">if</span> ( sos && sof0 ) <span style="color: rgb(181, 25, 161); ">break</span>;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span>}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><span style="white-space: pre-wrap; ">                </span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">if</span> ( <span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">sosIndex</span> > <span style="color: rgb(56, 13, 214); ">0</span> )</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">                </span><span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">sosSize</span> = sz - <span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">sosIndex</span>;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(201, 39, 34); ">
<span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">        </span>printf( </span>"Streaming image w=%d h=%d total_size=%d sos_size=%d\n"<span style="color: rgb(0, 0, 0); ">, fLastWidth * </span><span style="color: rgb(56, 13, 214); ">8</span><span style="color: rgb(0, 0, 0); ">, fLastHeight * </span><span style="color: rgb(56, 13, 214); ">8</span><span style="color: rgb(0, 0, 0); ">, (</span><span style="color: rgb(181, 25, 161); ">int</span><span style="color: rgb(0, 0, 0); ">)sz, </span><span style="color: rgb(181, 25, 161); ">this</span><span style="color: rgb(0, 0, 0); ">-></span><span style="color: rgb(85, 129, 135); ">sosSize</span><span style="color: rgb(0, 0, 0); "> );</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>fclose(fFid);</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>::~TestJPEGVideoSource()</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
{<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">if</span> ( <span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">buffer</span> ) <span style="color: rgb(181, 25, 161); ">delete</span> [] buffer;</p>
<div class="im" style="color: rgb(80, 0, 80); "><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="color: rgb(181, 25, 161); ">void</span> <span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>::doGetNextFrame()</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>fFrameSize = <span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">sosSize</span>;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">if</span> ( fFrameSize > fMaxSize )</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(201, 39, 34); ">
<span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">                </span>printf( </span>"Truncating frame!!\n"<span style="color: rgb(0, 0, 0); "> );</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span>fNumTruncatedBytes = fFrameSize - fMaxSize;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span>fFrameSize = fMaxSize;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>}</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>memcpy( fTo, <span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">buffer</span> + <span style="color: rgb(181, 25, 161); ">this</span>-><span style="color: rgb(85, 129, 135); ">sosIndex</span>, fFrameSize );</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">if</span> ( fPresentationTime.tv_sec == <span style="color: rgb(56, 13, 214); ">0</span> && fPresentationTime.tv_usec == <span style="color: rgb(56, 13, 214); ">0</span> )</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span>gettimeofday( &fPresentationTime, <span style="color: rgb(181, 25, 161); ">NULL</span> );</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>} </p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(181, 25, 161); "><span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">        </span></span>else</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span><span style="color: rgb(181, 25, 161); ">unsigned</span> uSeconds = fPresentationTime.tv_usec + ( fTimePerFrame * <span style="color: rgb(56, 13, 214); ">1000</span> );</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span>fPresentationTime.tv_sec += uSeconds / <span style="color: rgb(56, 13, 214); ">1000000</span>;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">                </span>fPresentationTime.tv_usec = uSeconds % <span style="color: rgb(56, 13, 214); ">1000000</span>;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; "><br></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
<span style="white-space: pre-wrap; ">        </span>fDurationInMicroseconds = fTimePerFrame * <span style="color: rgb(56, 13, 214); ">1000</span>;</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; min-height: 14px; ">
<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span>nextTask() = envir().taskScheduler().scheduleDelayedTask( <span style="color: rgb(56, 13, 214); ">0</span>, (TaskFunc*)FramedSource::afterGetting, <span style="color: rgb(181, 25, 161); ">this</span> );</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(85, 129, 135); ">
<span style="color: rgb(0, 0, 0); ">u_int8_t </span>TestJPEGVideoSource<span style="color: rgb(0, 0, 0); ">::type()</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
{<span style="white-space: pre-wrap; ">        </span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(181, 25, 161); "><span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">        </span></span>return<span style="color: rgb(0, 0, 0); "> </span><span style="color: rgb(56, 13, 214); ">1</span><span style="color: rgb(0, 0, 0); ">;</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
u_int8_t <span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>::qFactor()</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(181, 25, 161); "><span style="color: rgb(0, 0, 0); "><span style="white-space: pre-wrap; ">        </span></span>return<span style="color: rgb(0, 0, 0); "> </span><span style="color: rgb(56, 13, 214); ">65</span><span style="color: rgb(0, 0, 0); ">;</span></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; color: rgb(85, 129, 135); ">
<span style="color: rgb(0, 0, 0); ">u_int8_t </span>TestJPEGVideoSource<span style="color: rgb(0, 0, 0); ">::width()</span></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">return</span> fLastWidth;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
u_int8_t <span style="color: rgb(85, 129, 135); ">TestJPEGVideoSource</span>::height()</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">
{</p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; "><span style="white-space: pre-wrap; ">        </span><span style="color: rgb(181, 25, 161); ">return</span> fLastHeight;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Menlo; ">}</p></span>
</div>