chore[mpp_enc]: Encoder changes to cacheable buffer

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I8df399ff708e354f8e3017da41e1424cba4999ee
This commit is contained in:
Herman Chen
2023-11-10 17:25:17 +08:00
parent 5d89c2cc32
commit 0d773814cf
8 changed files with 97 additions and 19 deletions

View File

@@ -596,6 +596,7 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
RK_U32 eoi = 1;
if (p->fp_input) {
mpp_buffer_sync_begin(p->frm_buf);
ret = read_image(buf, p->fp_input, p->width, p->height,
p->hor_stride, p->ver_stride, p->fmt);
if (ret == MPP_NOK || feof(p->fp_input)) {
@@ -611,12 +612,15 @@ MPP_RET test_mpp_run(MpiEncMultiCtxInfo *info)
mpp_log_q(quiet, "chn %d found last frame. feof %d\n", chn, feof(p->fp_input));
} else if (ret == MPP_ERR_VALUE)
goto RET;
mpp_buffer_sync_end(p->frm_buf);
} else {
if (p->cam_ctx == NULL) {
mpp_buffer_sync_begin(p->frm_buf);
ret = fill_image(buf, p->width, p->height, p->hor_stride,
p->ver_stride, p->fmt, p->frame_count);
if (ret)
goto RET;
mpp_buffer_sync_end(p->frm_buf);
} else {
cam_frm_idx = camera_source_get_frame(p->cam_ctx);
mpp_assert(cam_frm_idx >= 0);
@@ -877,7 +881,7 @@ void *enc_test(void *arg)
goto MPP_TEST_OUT;
}
ret = mpp_buffer_group_get_internal(&p->buf_grp, MPP_BUFFER_TYPE_DRM);
ret = mpp_buffer_group_get_internal(&p->buf_grp, MPP_BUFFER_TYPE_DRM | MPP_BUFFER_FLAGS_CACHABLE);
if (ret) {
mpp_err_f("failed to get mpp buffer group ret %d\n", ret);
goto MPP_TEST_OUT;