fix[h264_dpb]: Add env variables to force fast play mode

env var: force_fast_play_mode

Change-Id: I678452de25e62ffcd0415fc21bbe4a7da4c792a7
Signed-off-by: Hongjin Li <vic.hong@rock-chips.com>
This commit is contained in:
Hongjin Li
2024-10-24 16:59:52 +08:00
parent 611a9a04b6
commit a14f1327aa

View File

@@ -349,7 +349,9 @@ MPP_RET h264d_init(void *decoder, ParserCfg *init)
FUN_CHECK(ret = init_vid_ctx(p_Dec->p_Vid)); FUN_CHECK(ret = init_vid_ctx(p_Dec->p_Vid));
FUN_CHECK(ret = init_dec_ctx(p_Dec)); FUN_CHECK(ret = init_dec_ctx(p_Dec));
p_Dec->immediate_out = p_Dec->cfg->base.fast_out; p_Dec->immediate_out = p_Dec->cfg->base.fast_out;
p_Dec->p_Vid->dpb_fast_out = p_Dec->cfg->base.enable_fast_play; mpp_env_get_u32("force_fast_play_mode", &p_Dec->p_Vid->dpb_fast_out,
p_Dec->cfg->base.enable_fast_play);
H264D_LOG("fast play mode: %d", p_Dec->p_Vid->dpb_fast_out);
p_Dec->p_Vid->dpb_first_fast_played = 0; p_Dec->p_Vid->dpb_first_fast_played = 0;
__RETURN: __RETURN:
return ret = MPP_OK; return ret = MPP_OK;
@@ -447,7 +449,9 @@ MPP_RET h264d_reset(void *decoder)
p_Dec->dxva_ctx->strm_offset = 0; p_Dec->dxva_ctx->strm_offset = 0;
p_Dec->dxva_ctx->slice_count = 0; p_Dec->dxva_ctx->slice_count = 0;
p_Dec->last_frame_slot_idx = -1; p_Dec->last_frame_slot_idx = -1;
p_Dec->p_Vid->dpb_fast_out = p_Dec->cfg->base.enable_fast_play; mpp_env_get_u32("force_fast_play_mode", &p_Dec->p_Vid->dpb_fast_out,
p_Dec->cfg->base.enable_fast_play);
H264D_LOG("fast play mode: %d", p_Dec->p_Vid->dpb_fast_out);
p_Dec->p_Vid->dpb_first_fast_played = 0; p_Dec->p_Vid->dpb_first_fast_played = 0;
__RETURN: __RETURN:
@@ -493,6 +497,9 @@ MPP_RET h264d_control(void *decoder, MpiCmd cmd_type, void *param)
switch (cmd_type) { switch (cmd_type) {
case MPP_DEC_SET_ENABLE_FAST_PLAY: case MPP_DEC_SET_ENABLE_FAST_PLAY:
p_Dec->p_Vid->dpb_fast_out = (param) ? (*((RK_U32 *)param)) : (1); p_Dec->p_Vid->dpb_fast_out = (param) ? (*((RK_U32 *)param)) : (1);
mpp_env_get_u32("force_fast_play_mode", &p_Dec->p_Vid->dpb_fast_out,
p_Dec->p_Vid->dpb_fast_out);
H264D_LOG("fast play mode: %d", p_Dec->p_Vid->dpb_fast_out);
break; break;
case MPP_DEC_SET_MAX_USE_BUFFER_SIZE : case MPP_DEC_SET_MAX_USE_BUFFER_SIZE :
p_Dec->p_Inp->max_buf_size = (param) ? (*((RK_U32 *)param)) : (0); p_Dec->p_Inp->max_buf_size = (param) ? (*((RK_U32 *)param)) : (0);