<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" style="word-wrap:break-word">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi Ross,<br>
<br>
Thanks for your comment. Here is the implementation of doGetNextFrame() in my class (which is indeed derived from FramedSource):<br>
<blockquote><font face="Courier New">void CAvSource::doGetNextFrame()<br>
{<br>
// Forward all frames in the input AV buffer<br>
while (getTopMetadata() != NULL)<br>
{<br>
deliverFrame();<br>
}<br>
}<br>
<br>
void CAvSource::deliverFrame()<br>
{<br>
av_data_t frame;<br>
int32_t ret = av_get_variable_frame(mAvBuffer, &frame, POLL_NOWAIT);<br>
if (ret <= 0)<br>
{<br>
log_error("Failed to get frame even if AV buffer told us some are "<br>
"available for av_buffer %p", mAvBuffer);<br>
return;<br>
}<br>
<br>
unsigned size = frame.num_bytes;<br>
if (size > fMaxSize)<br>
{<br>
fFrameSize = fMaxSize;<br>
fNumTruncatedBytes = size - fMaxSize;<br>
}<br>
else<br>
{<br>
fFrameSize = size;<br>
fNumTruncatedBytes = 0;<br>
}<br>
<br>
memmove(fTo, frame.virt_addr, fFrameSize);<br>
<br>
av_metadata_t* meta = frame.metadata;<br>
fPresentationTime.tv_sec = meta->time_usec_then / 1000000LL;<br>
fPresentationTime.tv_usec = meta->time_usec_then % 1000000LL;<br>
fDurationInMicroseconds = meta->time_usec_now - meta->time_usec_then;<br>
<br>
// We don't need the AV frame any more, so we can release it now.<br>
av_finished_with_variable_frame(mAvBuffer, 1);<br>
<br>
// Inform the reader that a new frame is available.<br>
FramedSource::afterGetting(this);<br>
}<br>
<br>
</font></blockquote>
Could it be that calling deliverFrame() multiple times might be wrong?<br>
<br>
Thanks a lot for your help!<br>
<br>
Fabrice<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF230048"><font color="#000000" face="Tahoma" size="2"><b>From:</b> live-devel [live-devel-bounces@ns.live555.com] on behalf of Ross Finlayson [finlayson@live555.com]<br>
<b>Sent:</b> 04 September 2014 17:21<br>
<b>To:</b> LIVE555 Streaming Media - development & use<br>
<b>Subject:</b> Re: [Live-devel] Please help: I have difficulties implementing the right classes<br>
</font><br>
</div>
<div></div>
<div><br>
<div>
<blockquote type="cite">
<div style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant:normal; font-weight:normal; letter-spacing:normal; line-height:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">
<div style="direction:ltr; font-family:Tahoma; font-size:10pt">I am trying to build an RTSP server using liveMedia to stream H.264 in real time from a live encoder. In essence, as soon as I try to connect with VLC, liveMedia abort()s with the following message:<br>
<blockquote><font face="Courier New">FramedSource[0xbe838]::getNextFrame(): attempting to read more than once at the same time!</font><br>
</blockquote>
</div>
</div>
</blockquote>
<div><br>
</div>
This error means that a "FramedSource" object (presumably of your subclass that you wrote to deliver live H.264 data from your encoder) is getting a call to "getNextFrame()" while it is already handling a previous call to "getNextFrame()".</div>
<div><br>
</div>
<div>I.e., it seems that your "FramedSource" subclass's implementation of "doGetNextFrame()" is incorrect; it apparently is not calling</div>
<div><span class="Apple-tab-span" style="white-space:pre"></span>FramedSource::afterGetting(this);</div>
<div>after it completes delivery to the downstream (i.e., calling) object.</div>
<div><br>
</div>
<div>(Also, you should use "testRTSPClient" and/or "openRTSP" as RTSP clients for testing, before using VLC. VLC is more complex, and is not our software.)</div>
<br>
<br>
<div><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"><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">Ross
Finlayson<br>
Live Networks, Inc.<br>
<a href="http://www.live555.com/" target="_blank">http://www.live555.com/</a></span></span>
</div>
<br>
</div>
</div>
</div>
</body>
</html>