<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV> </DIV>
<DIV>Hi Ross,</DIV>
<DIV> </DIV>
<DIV>I am facing a typical problem where the streaming stops after some time if
the encoded frame buffer size is more. If I keep the buffer size less
(ActualSize/8), streaming goes normal.</DIV>
<DIV> </DIV>
<DIV>I had implemented my own H264Source subclass of FramedSource (to read
frames at 30fps from USB camera and encodes using VPU encoder).</DIV>
<DIV>I am triggering the streaming thread at every 20ms and using
testProgs/testRTSPClient for testing the reception of streams. </DIV>
<DIV> </DIV>
<DIV>below is the code:</DIV>
<DIV> </DIV>
<DIV>void H264Source::deliverFrame() {</DIV>
<DIV> </DIV>
<DIV> if (!isCurrentlyAwaitingData()) return;</DIV>
<DIV> </DIV>
<DIV> u32 EncFrameSize = 0;</DIV>
<DIV> u32& newFrameSize = EncFrameSize;</DIV>
<DIV> static int k = 0;</DIV>
<DIV> </DIV>
<DIV> printf("Reading Frames: k = %d\r\n", k++);</DIV>
<DIV> </DIV>
<DIV> /* Get the frames from the camera */</DIV>
<DIV>
CameraDevice::getInstance()->GetFrame(m_pu8RawFrameBuff,
m_u16RawBuffLen);</DIV>
<DIV> </DIV>
<DIV> /* encode the frames with hardware encoder */</DIV>
<DIV> m_pEncoder->EncodeFrameBuff(m_pu8RawFrameBuff,
m_u16RawBuffLen, m_pu8EncFrameBuff, newFrameSize);</DIV>
<DIV> // After encoding newFrameSize can be maximum of 640 *
480 = 307200 */</DIV>
<DIV> </DIV>
<DIV> if (newFrameSize > fMaxSize) {</DIV>
<DIV> fFrameSize = fMaxSize;</DIV>
<DIV> fNumTruncatedBytes =
newFrameSize - fMaxSize;</DIV>
<DIV> } else {</DIV>
<DIV> fFrameSize = newFrameSize;</DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV> gettimeofday(&fPresentationTime, NULL);</DIV>
<DIV> memmove(fTo, m_pu8EncFrameBuff, fFrameSize);</DIV>
<DIV> </DIV>
<DIV> FramedSource::afterGetting(this);</DIV>
<DIV> </DIV>
<DIV> m_bProcessingDone = true;</DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">}</DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">Is the
problem with newFrameSize being too large or any other reason?</DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">Is my way
to getting the frames and processing is correct or Any other better way to
accomplish this? What is the maximum size of frames that is supported ? I need
to pass complete frames only for compatibility with the receiver
application.</DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt"> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">Thanks in
advance.<BR></DIV>
<DIV
style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">Ashfaque</DIV></DIV></DIV></BODY></HTML>