MLK-22822:VPU Encoder: check the stream buffer free space before encode
authorming_qian <ming.qian@nxp.com>
Tue, 22 Oct 2019 06:21:26 +0000 (14:21 +0800)
committerShijie Qin <shijie.qin@nxp.com>
Thu, 24 Oct 2019 10:58:36 +0000 (18:58 +0800)
commit0f7c65e0bcbb938a6c9c806e3827b176eccd02e7
tree56406021a24977ed7cef497be12c1f2a3ce29e7f
parentf165946d9984809d6fd1ab134ee00dffe1c83bc3
MLK-22822:VPU Encoder: check the stream buffer free space before encode
frame

If the free space of stream buffer is not enough for one frame,
vpu may overwrite the data or hang.
so check before encode frame can avoid it.
Add new ctrl V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE,
user can use this ctrl to set the coded picture buffer size.

Signed-off-by: ming_qian <ming.qian@nxp.com>
Reviewed-by: Shijie Qin <shijie.qin@nxp.com>
(cherry picked from commit 1af0b35c6bfffa57e27f0a39c8b040b93d973278)
drivers/mxc/vpu_malone/vpu_b0.h
drivers/mxc/vpu_malone/vpu_debug_log.h
drivers/mxc/vpu_malone/vpu_ts.h
drivers/mxc/vpu_windsor/vpu_encoder_b0.c
drivers/mxc/vpu_windsor/vpu_encoder_b0.h
drivers/mxc/vpu_windsor/vpu_encoder_ctrl.c
drivers/mxc/vpu_windsor/vpu_encoder_mem.c