[enc_cfg]: Update mirror transformation.

1. constraint the range of input argument.
2. add flip config, equal to vertical mirror transformation.
3. add mirroring_ext and rotation_ext to config set, for supporting
GET_CFG control.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Change-Id: I01c0b9187a18851354e81b5f08afc6dcaaba8365
This commit is contained in:
xueman.ruan
2022-09-16 15:20:23 +08:00
committed by Herman Chen
parent 8d905fe82e
commit 09de35e9b5
6 changed files with 104 additions and 15 deletions

View File

@@ -292,6 +292,9 @@ MPP_RET test_mpp_enc_cfg_setup(MpiEncMultiCtxInfo *info)
MppEncCfg cfg = p->cfg;
RK_U32 quiet = cmd->quiet;
MPP_RET ret;
RK_U32 rotation;
RK_U32 mirroring;
RK_U32 flip;
/* setup default parameter */
if (p->fps_in_den == 0)
@@ -456,6 +459,14 @@ MPP_RET test_mpp_enc_cfg_setup(MpiEncMultiCtxInfo *info)
mpp_enc_cfg_set_s32(cfg, "split:out", p->split_out);
}
mpp_env_get_u32("mirroring", &mirroring, 0);
mpp_env_get_u32("rotation", &rotation, 0);
mpp_env_get_u32("flip", &flip, 0);
mpp_enc_cfg_set_s32(cfg, "prep:mirroring", mirroring);
mpp_enc_cfg_set_s32(cfg, "prep:rotation", rotation);
mpp_enc_cfg_set_s32(cfg, "prep:flip", flip);
ret = mpi->control(ctx, MPP_ENC_SET_CFG, cfg);
if (ret) {
mpp_err("mpi control enc set cfg failed ret %d\n", ret);