mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-09 11:00:53 +08:00
[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:
@@ -772,10 +772,12 @@ MPP_RET h264d_callback(void *decoder, void *errinfo)
|
||||
INP_CHECK(ret, !decoder);
|
||||
FunctionIn(p_Dec->logctx.parr[RUN_PARSE]);
|
||||
|
||||
RK_U32 error_flag = 0;
|
||||
|
||||
|
||||
p_regs = (RK_U32*)errinfo;
|
||||
{
|
||||
MppFrame mframe = NULL;
|
||||
|
||||
RK_U32 out_slot_idx = p_regs[78];
|
||||
RK_U32 dpb_err_flag = p_regs[79];
|
||||
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 strmd_error_status = p_regs[45];
|
||||
RK_U32 strmd_error_detect_flag = p_regs[76] & 0x00008000; // strmd error detect flag
|
||||
|
||||
mpp_buf_slot_get_prop(p_Dec->frame_slots, out_slot_idx, SLOT_FRAME_PTR, &mframe);
|
||||
if (mframe) {
|
||||
if (dec_error_sta || (!dec_rdy_sta) || buf_empty_sta
|
||||
|| dpb_err_flag || strmd_error_status || strmd_error_detect_flag) {
|
||||
MppFrame mframe = NULL;
|
||||
mpp_buf_slot_get_prop(p_Dec->frame_slots, out_slot_idx, SLOT_FRAME_PTR, &mframe);
|
||||
if (ref_flag) {
|
||||
mpp_frame_set_errinfo(mframe, VPU_FRAME_ERR_UNKNOW);
|
||||
} else {
|
||||
}
|
||||
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, 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);
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
__RETURN:
|
||||
|
@@ -508,10 +508,7 @@ static MPP_RET check_dpb_discontinuous(H264_StorePic_t *p_last, H264_StorePic_t
|
||||
}
|
||||
}
|
||||
}
|
||||
return MPP_OK;
|
||||
|
||||
__FAILED:
|
||||
return ret;
|
||||
return ret = MPP_OK;
|
||||
}
|
||||
|
||||
static MPP_RET alloc_decpic(H264_SLICE_t *currSlice)
|
||||
|
@@ -881,10 +881,8 @@ MPP_RET parse_prepare_extra_data(H264dInputCtx_t *p_Inp, H264dCurCtx_t *p_Cur)
|
||||
ret = MPP_OK;
|
||||
__FAILED:
|
||||
//p_strm->nalu_len = 0;
|
||||
p_Cur->curr_dts = p_Inp->in_dts;
|
||||
p_Cur->curr_pts = p_Inp->in_pts;
|
||||
p_Cur->last_dts = p_Cur->curr_dts;
|
||||
p_Cur->last_pts = p_Cur->curr_pts;
|
||||
p_Cur->last_dts = p_Inp->in_dts;
|
||||
p_Cur->last_dts = p_Inp->in_pts;
|
||||
p_Inp->p_Dec->nalu_ret = HaveNoStream;
|
||||
|
||||
return ret;
|
||||
|
@@ -235,12 +235,12 @@ RK_S32 VpuApi:: decode_getoutframe(DecoderOut_t *aDecOut)
|
||||
}
|
||||
fwrite(fp_buf, 1, img_w * img_h * 3 / 2, fp);
|
||||
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 {
|
||||
fwrite(ptr, 1, vframe->FrameWidth * vframe->FrameHeight * 3 / 2, fp);
|
||||
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);
|
||||
|
Reference in New Issue
Block a user