[Live-devel] Live555 EventLoop Crash

David J Myers david.myers at panogenics.com
Wed Dec 21 04:31:46 PST 2011


Hi Ross

You wrote:

>But in your first message, you talked about "5MP" images.  Did you mean "5
MByte images"; "5 Megapixel images"?  In any case, what codec is this?
I.e., what kind of data are you trying to stream?

 

Yes, I am trying to stream H.264 compressed live images from my camera
sensor which are 2144x1944 pixels, so just under 5MegaPixels. I'm using
h264videoStreamFramer directly and H264VideoRTPSink downstream.

My deliver frame function looks like this, virtually copied from your
DeviceSource sample, except for where we get the frame from our
inter-process buffers.

void StreamSource::deliverFrame()

{          

     streamSubStream_t *substream = m_substream;

 

     FUNCTION_TRACE;

     

     if (!isCurrentlyAwaitingData() || (substream == NULL))

     {

         TRACE ("NoData, substream=0x%p\r\n", substream);

         return;

     }

 

     TRACE("Max Frame size = %u\r\n", fMaxSize);

 

     fNumTruncatedBytes = 0;

     //fDurationInMicroseconds = ;   // not set

     //get the next frame buffer for streaming

     CStreamBuffer * pBuffer =
substream->pStreamManager->GetNewestBufferForStreaming(substream->iSeqNumber
);

     if (pBuffer == NULL)

     {

           TRACE("deliverFrame had no data\r\n");

           return; //no data, have to wait for main thread to signal Live555
to call us back later

     }

     substream->iSeqNumber = pBuffer->GetSequenceNumber(); //we have the
frame so save Sequence number ready for next one

     TRACE("deliverFrame(): Stream:%d, Sequence Number:%lu\r\n",
substream->iStreamNo, substream->iSeqNumber);

     unsigned newFrameSize = pBuffer->GetDataSize();

     if (newFrameSize > fMaxSize)

     {

         fFrameSize = fMaxSize;

         fNumTruncatedBytes = newFrameSize - fMaxSize;

           INFO("deliverFrame(): Stream:%d, Frame size:%u, %u bytes
truncated\r\n", substream->iStreamNo, newFrameSize, fNumTruncatedBytes);

     }

     else

     {

         fFrameSize = newFrameSize;

     }

     gettimeofday(&fPresentationTime, NULL);

     memmove(fTo, pBuffer->GetDataPtr(), fFrameSize);

 

     TRACE("deliverFrame %d bytes delivered\r\n", fFrameSize);

 

     //return buffer back to Stream Manager

     substream->pStreamManager->ReturnBufferAfterStreaming(pBuffer);

 

     FramedSource::afterGetting(this);

}

In my corresponding "pushFrame" function, I save the current frame from the
encoder and then call signalNewFrame to signal the event to the scheduler,
also as per the DeviceSource sample. However, whatever I set the
OutPacketBuffer::maxSize to, I end up truncating frames in the above
function. BANK_SIZE in StreamParser.cpp also seems to be critical. If I
increase the BANK_SIZE value I get less frequent truncations but still can't
stop them completely. 

If the problem is in my code, please could you suggest where else I should
look?

Best regards - David

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20111221/06fc753b/attachment-0001.html>


More information about the live-devel mailing list