<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" id="owaParaStyle" style="display: none;">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body dir="ltr" fpstyle="1" aria-label="Message body" tabindex="0">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0">
<div><br>
</div>
Thanks for the response. Ok, does that mean the data in the sink will have already been processed by <span style="font-size: 12pt;">JPEGVideoRTPSource</span><span style="font-size: 12pt;">::processSpecialHeader()? I know the source object is correctly set to
 be JPEGVideoRTPSource, but I don't know if this member function gets called automatically in the RTP processing.</span>
<div>
<div><br>
</div>
<div>I wonder if there is a bug in the JPEG packet processing because I write each JPEG frame to a file, and each appears very corrupted. It's definitely a JPEG because it opens in an image viewer, and it has the right dimensions. However, each image looks
 like garbage.</div>
<div><br>
</div>
<div><span style="font-size: 12pt;">I put the following code in testRTSPClient.</span></div>
<div>
<div><br>
</div>
<div>
<div><font size="2">void DummySink::afterGettingFrame(unsigned frameSize, unsigned numTruncatedBytes,</font></div>
<div><font size="2"><span class="Apple-tab-span" style="white-space:pre"></span> struct timeval presentationTime, unsigned /*durationInMicroseconds*/) {</font></div>
<div><span style="font-size: small;">  </span></div>
<div><font size="2">  FrameCount++;</font></div>
<div><font size="2">  char fname[2048];</font></div>
<div><font size="2">  sprintf(fname, "image_%04d.jpg", FrameCount);</font></div>
<div><font size="2">  FILE *fout = fopen(fname,"w");</font></div>
<div><font size="2"><br>
</font></div>
<div><font size="2">  fwrite(fReceiveBuffer, frameSize, 1, fout);</font></div>
<div><font size="2"><br>
</font></div>
<div><font size="2">  fclose(fout);</font></div>
<div><font size="2"><br>
</font></div>
<div><font size="2">  // Then continue, to request the next frame of data:</font></div>
<div><font size="2">  continuePlaying();</font></div>
<div><font size="2">}</font></div>
<div><br>
</div>
<div><br>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<table border="0" cellspacing="0" cellpadding="0" style="color:rgb(40,40,40); font-family:'Segoe UI WPC','Segoe UI',Tahoma,'Microsoft Sans Serif',Verdana,sans-serif; font-size:15px; background-color:rgb(255,255,255); border-collapse:collapse">
<tbody>
<tr height="59" style="height:35.5pt">
<td width="97" valign="top" style="width:58.2pt; height:35.5pt; padding:0px 5.4pt; border-style:none solid none none; border-right-width:1pt; border-right-color:windowtext">
<div align="right" style="margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt">  </span></font></div>
</td>
<td width="435" valign="top" style="width:261pt; height:35.5pt; padding:0px 5.4pt; border-style:none">
<div style="margin:0px 0px 2pt"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><a tabindex="0" href="mailto:tim.gee@aldiscorp.com" target="_blank"><font face="Verdana,sans-serif" size="1"><span style="font-size:8pt"><b><font color="windowtext">Tim
 Gee</font></b></span></font></a><font face="Verdana,sans-serif" size="1"><span style="font-size:8pt"><b> </b></span></font><font face="Verdana,sans-serif" size="1" color="#404040"><span style="font-size:7pt">| Senior R&D Engineer</span></font></span></font></div>
<div style="margin:0px 0px 2pt"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><a tabindex="0" href="http://www.aldiscorp.com/" target="_blank"><font face="Verdana,sans-serif" size="1"><span style="font-size:7pt"><b><font color="windowtext">Aldis</font></b></span></font></a><font face="Verdana,sans-serif" size="1" color="#404040"><span style="font-size:7pt"> |
 10545 Hardin Valley Rd. | Knoxville TN | 37932</span></font></span></font></div>
<div style="margin:0px 0px 2pt"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"><font face="Verdana,sans-serif" size="1" color="#404040"><span style="font-size:7pt">o: 865-978-6535 | f: 865-249-6608</span></font></span></font></div>
</td>
</tr>
<tr>
<td colspan="2" width="532" valign="top" style="width:319.2pt; padding:0px 5.4pt">
<div align="center" style="text-align:center; margin:0px"><font face="Calibri,sans-serif" size="2"><span style="font-size:11pt"> </span></font></div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div style="color: rgb(40, 40, 40);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> live-devel-bounces@ns.live555.com <live-devel-bounces@ns.live555.com> on behalf of Ross Finlayson <finlayson@live555.com><br>
<b>Sent:</b> Tuesday, July 23, 2013 10:12 PM<br>
<b>To:</b> LIVE555 Streaming Media - development & use<br>
<b>Subject:</b> Re: [Live-devel] testRTSPClient and MJPEG decoding</font>
<div> </div>
</div>
<div>
<div>
<blockquote type="cite">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:2; text-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing:0px; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; margin:0px">
<div>I have been working with the testRTSPClient example for reading from an MJPEG camera. I understand that when afterGettingFrame() is called, fReceiveBuffer contains the raw RTP packet</div>
</div>
</blockquote>
<div><br>
</div>
You understand incorrectly.  All of the RTP (and RTCP) processing is done by our code; that's why our code is there.  When a RTP receiver (in this case, our "testRTSPClient" application) receives data, it will be a complete (audio or video) frame.  In the case
 of a JPEG/RTP stream (served by a RTSP server - such as a network camera), the received data will be a complete JPEG frame.</div>
<br>
<br>
<div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; 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-indent:0px; text-transform:none; white-space:normal; widows:2; word-spacing: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>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>