author | Song Zhao <song.zhao@amlogic.com> | 2020-06-26 06:41:30 (GMT) |
---|---|---|
committer | Hui Zhang <hui.zhang@amlogic.com> | 2020-07-01 05:05:45 (GMT) |
commit | 7f5c772be5027d2534d1637a0a3f01e5528e52a4 (patch) | |
tree | eb9280f63b7af68dc0b4820670690e995d09f28b | |
parent | 1ccd1c0722dda7718bd7cf649ab6890c9f70a167 (diff) | |
download | media_modules-7f5c772be5027d2534d1637a0a3f01e5528e52a4.zip media_modules-7f5c772be5027d2534d1637a0a3f01e5528e52a4.tar.gz media_modules-7f5c772be5027d2534d1637a0a3f01e5528e52a4.tar.bz2 |
h264_dec: config buf specs after resolution change [1/1]
PD#SWPL-28501
Problem:
In V4L2 mode, resolution change will trigger reset() and all the
canvas are released with h264_reconfig(). When it continues decoding
the data with new resolution, decoder will write to invalid canvas.
Solution:
In vh264_set_params() call config_buf_specs in V4L2 mode.
Verify:
U212
gst-play-1.0 http://www.bok.net/dash/tears_of_steel/cleartext/stream.mpd
Change-Id: Ia57678e91001d719b9477a62fcae7688455decfd
Signed-off-by: Song Zhao <song.zhao@amlogic.com>
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_dec.c | 2 | ||||
-rw-r--r-- | drivers/frame_provider/decoder/h264_multi/vmh264.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c index 2d426d1..14d83b0 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.c +++ b/drivers/amvdec_ports/aml_vcodec_dec.c @@ -546,6 +546,8 @@ void trans_vframe_to_user(struct aml_vcodec_ctx *ctx, struct vdec_v4l2_buffer *f if (dstbuf->frame_buffer.num_planes == 2) kernel_write(fp,vb2_plane_vaddr(vb, 1), vb->planes[1].bytesused, 0); + pr_info("dump idx: %d %dx%d\n", dump_capture_frame, vf->width, vf->height); + dump_capture_frame--; filp_close(fp, NULL); } } diff --git a/drivers/frame_provider/decoder/h264_multi/vmh264.c b/drivers/frame_provider/decoder/h264_multi/vmh264.c index b06211d..8e877eb 100644 --- a/drivers/frame_provider/decoder/h264_multi/vmh264.c +++ b/drivers/frame_provider/decoder/h264_multi/vmh264.c @@ -4929,7 +4929,7 @@ static int vh264_set_params(struct vdec_h264_hw_s *hw, mutex_lock(&vmh264_mutex); if (!hw->mmu_enable) { - if (!buffer_reset_flag) + if (!buffer_reset_flag || hw->is_used_v4l) config_buf_specs(vdec); i = get_buf_spec_by_canvas_pos(hw, 0); @@ -9185,6 +9185,8 @@ static void reset(struct vdec_s *vdec) hw->eos = 0; hw->decode_pic_count = 0; hw->dec_result = DEC_RESULT_NONE; + /* v4l will reset on every res change */ + hw->res_ch_flag = 0; clear_refer_bufs(hw); reset_process_time(hw); |