[test]: Add read packet config function

When mpp output packet binary file with size config file test case
should be enable to parser the corresponding config file.
This patch implement the config file option with "-c" prefix.

Command line sample:
mpi_dec_test -t 7 -i /sdcard/in.bin -i /sdcard/ops.bin
Then the test case will read in.bin file with size division specified
in ops.bin.

Change-Id: I8b18a6475d77f0303f12614a063888dcd9505f16
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2018-10-12 09:11:45 +08:00
parent a0f76729d5
commit 4553fac11e
3 changed files with 90 additions and 3 deletions

View File

@@ -385,3 +385,12 @@ MPP_RET fill_yuv_image(RK_U8 *buf, RK_U32 width, RK_U32 height,
}
return ret;
}
RK_S32 parse_config_line(const char *str, OpsLine *info)
{
RK_S32 cnt = sscanf(str, "%*[^,],%d,%[^,],%llu,%llu\n",
&info->index, info->cmd,
&info->value1, &info->value2);
return cnt;
}