mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-11-03 01:33:35 +08:00
[jpegd]: add errinfo for output frame
If input stream or hardware interrupt is error, errinfo of output frame will be set to 1. Change-Id: I50cf9d7d69b5530043f50a56b13ed4b2417ac40d Signed-off-by: timkingh.huang <timkingh.huang@rock-chips.com>
This commit is contained in:
@@ -889,6 +889,7 @@ void *mpp_dec_advanced_thread(void *data)
|
||||
ret = parser_parse(dec->parser, task_dec);
|
||||
if (ret != MPP_OK) {
|
||||
mpp_err_f("something wrong with parser_parse!\n");
|
||||
mpp_frame_set_errinfo(frame, 1); /* 0 - OK; 1 - error */
|
||||
mpp_buf_slot_clr_flag(packet_slots, task_dec->input, SLOT_HAL_INPUT);
|
||||
goto DEC_OUT;
|
||||
}
|
||||
@@ -923,6 +924,7 @@ void *mpp_dec_advanced_thread(void *data)
|
||||
mpp_frame_set_ver_stride(frame, mpp_frame_get_ver_stride(tmp));
|
||||
mpp_frame_set_pts(frame, mpp_frame_get_pts(tmp));
|
||||
mpp_frame_set_fmt(frame, mpp_frame_get_fmt(tmp));
|
||||
mpp_frame_set_errinfo(frame, mpp_frame_get_errinfo(tmp));
|
||||
|
||||
mpp_buf_slot_clr_flag(packet_slots, task_dec->input, SLOT_HAL_INPUT);
|
||||
mpp_buf_slot_clr_flag(frame_slots, task_dec->output, SLOT_HAL_OUTPUT);
|
||||
@@ -932,6 +934,7 @@ void *mpp_dec_advanced_thread(void *data)
|
||||
*/
|
||||
mpp_log_f("line(%d): Error! Get no buffer from input packet\n", __LINE__);
|
||||
mpp_frame_init(&frame);
|
||||
mpp_frame_set_errinfo(frame, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2086,6 +2086,8 @@ MPP_RET hal_jpegd_wait(void *hal, HalTaskInfo *task)
|
||||
JpegRegSet reg_out;
|
||||
VPU_CMD_TYPE cmd = 0;
|
||||
RK_S32 length = 0;
|
||||
RK_U32 errinfo = 1;
|
||||
MppFrame tmp = NULL;
|
||||
memset(®_out, 0, sizeof(JpegRegSet));
|
||||
|
||||
ret = VPUClientWaitResult(JpegHalCtx->vpu_socket, (RK_U32 *)®_out, JPEGD_REG_NUM, &cmd, &length);
|
||||
@@ -2098,9 +2100,13 @@ MPP_RET hal_jpegd_wait(void *hal, HalTaskInfo *task)
|
||||
} else if (reg_out.reg55_Interrupt.sw_dec_buffer_int) {
|
||||
JPEGD_ERROR_LOG("IRQ BUFFER EMPTY!");
|
||||
} else if (reg_out.reg55_Interrupt.sw_dec_irq) {
|
||||
errinfo = 0;
|
||||
JPEGD_INFO_LOG("DECODE SUCCESS!");
|
||||
}
|
||||
|
||||
mpp_buf_slot_get_prop(JpegHalCtx->frame_slots, task->dec.output, SLOT_FRAME_PTR, &tmp);
|
||||
mpp_frame_set_errinfo(tmp, errinfo);
|
||||
|
||||
/* debug information */
|
||||
if (JpegHalCtx->hal_debug_enable && JpegHalCtx->output_yuv_count < 3) {
|
||||
static FILE *jpg_file;
|
||||
|
||||
Reference in New Issue
Block a user