Dear Sir/Madam,
Please help, we require urgently
We get mpeg4 and h264 stream from ip cam, remove RTP headers, and pass to UMC
Only Mpeg4 strream is getting decoded and displayed properly, but when h264 stream is given for decoding ,italways returns -996 UMC_ERR_NOT_ENOUGH_DATA
please find the attached stream file
My Code is given below
Ipp32s width=320,height=240;
UMC::ColorFormat color_format=UMC::YV12;
UMC::MPEG4VideoDecoder *mpeg4Decoder ;
UMC::H264VideoDecoder *h264Decoder;
UMC::VideoDecoderParams *params ;
UMC::MediaData *pIn;
UMC::VideoData *pOut ;
mpeg4Decoder = new UMC::MPEG4VideoDecoder();
h264Decoder = new UMC::H264VideoDecoder();
params = new UMC::VideoDecoderParams();
pIn = new UMC::MediaData;
pOut = new UMC::VideoData;
//this function gets called for each frame(I/P/B) received
void Buffer(char *szData, int nLen)
{
if(!g_bInit)//first frame initialize
{
g_bInit = true;
pIn->SetBufferPointer((Ipp8u *)szData,nLen);
pIn->SetDataSize(nLen);
params->m_pData = pIn;
//if (UMC::UMC_OK != (mpeg4Decoder->Init(params))) MPEG Decoder stream is working
//{
////Process errors
//}
if (UMC::UMC_OK != (h264Decoder->Init(params)))
{
//Process errors
}
pOut->Init(width, height, color_format);
pOut->Alloc();
}
pIn->SetBufferPointer((Ipp8u *)szData,nLen);
pIn->SetDataSize(nLen);
// Decoding stream using GetFrame(pIn, pOut) method
//UMC::Status stRes = mpeg4Decoder->GetFrame(pIn,pOut);
UMC::Status stRes = h264Decoder->GetFrame(pIn,pOut);//always returns -996 ie UMC_ERR_NOT_ENOUGH_DATA
if(UMC::UMC_OK == stRes)
{
((CRTSPappDlg*)g_hWnd)->staticDisplay.DisplayImage((BYTE*)pOut->GetDataPointer(),width,height,24,"");// this code displays the frame
SaveImage((BYTE*)pOut->GetDataPointer(),width,height,24);//this save to bmp file
}
//delete mpeg4Decoder; //destructor automatically calls Close() method.
//delete h264Decoder; //destructor automatically calls Close() method.
}
Please help!!!!!!
thanks in advance