[h264d] h264d_callback, add NULL check; remove warning;

[vpu_api_legacy]   add timeUs when dump write yuv 

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@699 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
DingWei
2016-05-07 15:30:46 +00:00
parent f498795a98
commit 6a6bba0f3a
4 changed files with 21 additions and 22 deletions

View File

@@ -772,10 +772,12 @@ MPP_RET h264d_callback(void *decoder, void *errinfo)
INP_CHECK(ret, !decoder); INP_CHECK(ret, !decoder);
FunctionIn(p_Dec->logctx.parr[RUN_PARSE]); FunctionIn(p_Dec->logctx.parr[RUN_PARSE]);
RK_U32 error_flag = 0;
p_regs = (RK_U32*)errinfo; p_regs = (RK_U32*)errinfo;
{ {
MppFrame mframe = NULL;
RK_U32 out_slot_idx = p_regs[78]; RK_U32 out_slot_idx = p_regs[78];
RK_U32 dpb_err_flag = p_regs[79]; RK_U32 dpb_err_flag = p_regs[79];
RK_U32 ref_flag = p_regs[80]; RK_U32 ref_flag = p_regs[80];
@@ -784,19 +786,21 @@ MPP_RET h264d_callback(void *decoder, void *errinfo)
RK_U32 buf_empty_sta = p_regs[1] & 0x00010000; RK_U32 buf_empty_sta = p_regs[1] & 0x00010000;
RK_U32 strmd_error_status = p_regs[45]; RK_U32 strmd_error_status = p_regs[45];
RK_U32 strmd_error_detect_flag = p_regs[76] & 0x00008000; // strmd error detect flag RK_U32 strmd_error_detect_flag = p_regs[76] & 0x00008000; // strmd error detect flag
if (dec_error_sta || (!dec_rdy_sta) || buf_empty_sta
|| dpb_err_flag || strmd_error_status || strmd_error_detect_flag) { mpp_buf_slot_get_prop(p_Dec->frame_slots, out_slot_idx, SLOT_FRAME_PTR, &mframe);
MppFrame mframe = NULL; if (mframe) {
mpp_buf_slot_get_prop(p_Dec->frame_slots, out_slot_idx, SLOT_FRAME_PTR, &mframe); if (dec_error_sta || (!dec_rdy_sta) || buf_empty_sta
if (ref_flag) { || dpb_err_flag || strmd_error_status || strmd_error_detect_flag) {
mpp_frame_set_errinfo(mframe, VPU_FRAME_ERR_UNKNOW); if (ref_flag) {
} else { mpp_frame_set_errinfo(mframe, VPU_FRAME_ERR_UNKNOW);
mpp_frame_set_discard(mframe, VPU_FRAME_ERR_UNKNOW); }
else {
mpp_frame_set_discard(mframe, VPU_FRAME_ERR_UNKNOW);
}
} }
error_flag = 1; H264D_DBG(H264D_DBG_CALLBACK, "[CALLBACK] g_no=%d, s_idx=%d, sw[01]=%08x, sw[45]=%08x, sw[76]=%08x, dpberr=%d, ref=%d, errinfo=%d",
p_Dec->p_Vid->g_framecnt, out_slot_idx, p_regs[1], p_regs[45], p_regs[76], dpb_err_flag, ref_flag, mpp_frame_get_errinfo(mframe));
} }
H264D_DBG(H264D_DBG_CALLBACK, "[CALLBACK] g_no=%d, s_idx=%d, sw[01]=%08x, sw[45]=%08x, sw[76]=%08x, dpberr=%d, ref=%d, err=%d",
p_Dec->p_Vid->g_framecnt, out_slot_idx, p_regs[1], p_regs[45], p_regs[76], dpb_err_flag, ref_flag, error_flag);
} }
__RETURN: __RETURN:

View File

@@ -508,10 +508,7 @@ static MPP_RET check_dpb_discontinuous(H264_StorePic_t *p_last, H264_StorePic_t
} }
} }
} }
return MPP_OK; return ret = MPP_OK;
__FAILED:
return ret;
} }
static MPP_RET alloc_decpic(H264_SLICE_t *currSlice) static MPP_RET alloc_decpic(H264_SLICE_t *currSlice)

View File

@@ -881,10 +881,8 @@ MPP_RET parse_prepare_extra_data(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
ret = MPP_OK; ret = MPP_OK;
__FAILED: __FAILED:
//p_strm->nalu_len = 0; //p_strm->nalu_len = 0;
p_Cur->curr_dts = p_Inp->in_dts; p_Cur->last_dts = p_Inp->in_dts;
p_Cur->curr_pts = p_Inp->in_pts; p_Cur->last_dts = p_Inp->in_pts;
p_Cur->last_dts = p_Cur->curr_dts;
p_Cur->last_pts = p_Cur->curr_pts;
p_Inp->p_Dec->nalu_ret = HaveNoStream; p_Inp->p_Dec->nalu_ret = HaveNoStream;
return ret; return ret;

View File

@@ -235,12 +235,12 @@ RK_S32 VpuApi:: decode_getoutframe(DecoderOut_t *aDecOut)
} }
fwrite(fp_buf, 1, img_w * img_h * 3 / 2, fp); fwrite(fp_buf, 1, img_w * img_h * 3 / 2, fp);
if (vpu_api_debug & VPU_API_DBG_DUMP_LOG) { if (vpu_api_debug & VPU_API_DBG_DUMP_LOG) {
mpp_log("[write_out_yuv] FrameWidth = %d, FrameHeight = %d", img_w, img_h); mpp_log("[write_out_yuv] timeUs=%lld, FrameWidth=%d, FrameHeight=%d", aDecOut->timeUs, img_w, img_h);
} }
} else { } else {
fwrite(ptr, 1, vframe->FrameWidth * vframe->FrameHeight * 3 / 2, fp); fwrite(ptr, 1, vframe->FrameWidth * vframe->FrameHeight * 3 / 2, fp);
if (vpu_api_debug & VPU_API_DBG_DUMP_LOG) { if (vpu_api_debug & VPU_API_DBG_DUMP_LOG) {
mpp_log("[write_out_yuv] FrameWidth = %d, FrameHeight = %d", vframe->FrameWidth, vframe->FrameHeight); mpp_log("[write_out_yuv] timeUs=%lld, FrameWidth=%d, FrameHeight=%d", aDecOut->timeUs, vframe->FrameWidth, vframe->FrameHeight);
} }
} }
fflush(fp); fflush(fp);