h264dec version:H264DEC.version.01.00.00.08.wizardversion.0.5.3
dvsdk version:dvsdk_2_10_00_17
The main parameters in the programme:
VIDDEC2_Params *params:
params->maxFrameRate = 25000;
params->maxWidth = 720;
params->maxHeight = 576;
params->maxBitRate = 1048576;
params->forceChromaFormat = XDM_YUV_420SP;
paras->dataEndianess = XDM_BYTE;
params->size = sizeof(IH264VDEC_Params);
VIDDEC2_DynamicParams *dynParams:
dynParams->size = sizeof(VIDDEC2_DynamicParams);
dynParams->decodeHeader = XDM_DECODE_AU;
dynParams->displayWidth = 0;
dynParams->frameSkipMode = IVIDEO_NO_SKIP;
dynParams->frameOrder = IVIDDEC2_DECODE_ORDER;
dynParams->newFrameFlag =0;
dynParams->mbDataFlag=0;
IH264VDEC_Params extnParams:
extnParams.displayDelay = 0;
extnParams.hdvicpHandle = (void*) NULL;
extnParams.resetHDVICPeveryFrame = 0;
extnParams.disableHDVICPeveryFrame =1;
extnParams.viddecParams = *params;
BufferGfx_Attrs gfxAttrs= BufferGfx_Attrs_DEFAULT:
gfxAttrs.bAttrs.useMask = CODEC_FREE | DISPLAY_FREE;
gfxAttrs.colorSpace =ColorSpace_YUV420PSEMI;
gfxAttrs.dim.width = params->maxWidth;
gfxAttrs.dim.height = params->maxHeight;
gfxAttrs.dim.lineLength = BufferGfx_calcLineLength(gfxAttrs.dim.width,colorSpace);
In the programme i add a time print like below:
gettimeofday(&uTimeStart, NULL);
ret = Vdec2_process(hVd2, hInBuf, hDstBuf);
if (ret < 0)
{
ERR("Failed to decode video buffer\n");
cleanup(THREAD_FAILURE);
}
gettimeofday(&uTimeStop, NULL);
timeDelta = (unsigned long)((uTimeStop.tv_sec-uTimeStart.tv_sec)*1000000+(uTimeStop.tv_usec-uTimeStart.tv_usec));
fprintf(stderr,"videoThread decode time: %ld ms,%ld us\n",timeDelta/1000, timeDelta);
The time print results are :
videoThread decode time: 11 ms,11938 us
videoThread decode time: 12 ms,12230 us
videoThread decode time: 11 ms,11805 us
videoThread decode time: 12 ms,12171 us
....
videoThread decode time: 13 ms,13790 us
videoThread decode time: 15 ms,15033 us
videoThread decode time: 13 ms,13749 us
videoThread decode time: 14 ms,14163 us
videoThread decode time: 13 ms,13908 us
...
videoThread decode time: 11 ms,11765 us
videoThread decode time: 12 ms,12190 us
videoThread decode time: 15 ms,15088 us
videoThread decode time: 11 ms,11741 us
videoThread decode time: 11 ms,11934 us
videoThread decode time: 12 ms,12241 us
...
I want to decode the video streams which i recv from rtsp pthread and display by a LCD TV & MONITOR.(The programme decode flow is the same with the demo )
My problem is :
The programme run correctly in the beginning, display no delay ,but after several hours , the display delay for 1~3 seconds(show by the monitor).
I really don't known how to debug it , like the time print show , it is something abnormal with the "Vdec2_process"??
Pls help me , any advice will be appreciate.
Best ragards,
Katee