author | Yixin Peng <yixin.peng@amlogic.com> | 2019-12-12 02:43:44 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-01-16 11:49:33 (GMT) |
commit | 3ba925c5c9237322cc84d9103ac6c7e56d193354 (patch) | |
tree | cb8a0d3fdcc3b6aa6c571a39540c8e3922621f72 | |
parent | 4890e0c2aa5dbf09f26764fffcfa7e5a61302c13 (diff) | |
download | media_modules-3ba925c5c9237322cc84d9103ac6c7e56d193354.zip media_modules-3ba925c5c9237322cc84d9103ac6c7e56d193354.tar.gz media_modules-3ba925c5c9237322cc84d9103ac6c7e56d193354.tar.bz2 |
media_module: h264 playback freeze on v4l2. [1/1]
PD#SWPL-18089
Problem:
h264 playback freeze on v4l2.
Solution:
1. Solve the DPB size error of v4l2 parsing.
2. Solve the problem of v4l2 not detecting
the video switch.
Verify:
AC214
Change-Id: I31a7b91d604f3e7ef535f11c546a15b73e469da3
Signed-off-by: Yixin Peng <yixin.peng@amlogic.com>
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_drv.h | 1 | ||||
-rw-r--r-- | drivers/amvdec_ports/decoder/aml_h264_parser.c | 4 | ||||
-rw-r--r-- | drivers/amvdec_ports/decoder/vdec_h264_if.c | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_drv.h b/drivers/amvdec_ports/aml_vcodec_drv.h index 1baec44..d3d8284 100644 --- a/drivers/amvdec_ports/aml_vcodec_drv.h +++ b/drivers/amvdec_ports/aml_vcodec_drv.h @@ -266,6 +266,7 @@ struct vdec_pic_info { unsigned int y_len_sz; unsigned int c_len_sz; int profile_idc; + int ref_frame_count; }; struct aml_vdec_cfg_infos { diff --git a/drivers/amvdec_ports/decoder/aml_h264_parser.c b/drivers/amvdec_ports/decoder/aml_h264_parser.c index 602633b..0e8b881 100644 --- a/drivers/amvdec_ports/decoder/aml_h264_parser.c +++ b/drivers/amvdec_ports/decoder/aml_h264_parser.c @@ -492,7 +492,7 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s if (get_bits_left(gb) < 0) { pr_info("Overread %s by %d bits\n", sps->vui_parameters_present_flag ? "VUI" : "SPS", -get_bits_left(gb)); - goto out; + /*goto out;*/ } #if 0 @@ -533,7 +533,7 @@ static int aml_h264_parser_sps(struct get_bits_context *gb, struct h264_SPS_t *s if (!sps->sar.den) sps->sar.den = 1; -out: +/*out:*/ if (1) { static const char csp[4][5] = { "Gray", "420", "422", "444" }; pr_info("sps:%u profile:%d/%d poc:%d ref:%d %dx%d %s %s crop:%u/%u/%u/%u %s %s %d/%d b%d reo:%d\n", diff --git a/drivers/amvdec_ports/decoder/vdec_h264_if.c b/drivers/amvdec_ports/decoder/vdec_h264_if.c index eada4ea..30cc441 100644 --- a/drivers/amvdec_ports/decoder/vdec_h264_if.c +++ b/drivers/amvdec_ports/decoder/vdec_h264_if.c @@ -485,7 +485,7 @@ static void fill_vdec_params(struct vdec_h264_inst *inst, struct h264_SPS_t *sps pic->y_len_sz = pic->coded_width * pic->coded_height; pic->c_len_sz = pic->y_len_sz >> 1; pic->profile_idc = sps->profile_idc; - + pic->ref_frame_count= sps->ref_frame_count; /* calc DPB size */ dec->dpb_sz = sps->num_reorder_frames + margin; @@ -810,7 +810,9 @@ static bool monitor_res_change(struct vdec_h264_inst *inst, u8 *buf, u32 size) inst->vsi->cur_pic.coded_height != inst->vsi->pic.coded_height) || (inst->vsi->pic.profile_idc != - inst->vsi->cur_pic.profile_idc))) { + inst->vsi->cur_pic.profile_idc) || + (inst->vsi->pic.ref_frame_count != + inst->vsi->cur_pic.ref_frame_count))) { pr_info("res change\n"); inst->vsi->cur_pic = inst->vsi->pic; return true; |