[mpp]: Combine block control and timeout control

Use MppPollType as block control MPP_SET_INPUT_TIMEOUT and
MPP_SET_OUTPUT_TIMEOUT 's parameter.
Deprecate old block/block_timeout control.

Next step is to change MppPollType to RK_S64 for compatible in different
platform.

Change-Id: I02974f0b8eeb23ff43687448d6c3271ea7dd0a2c
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2018-06-28 11:04:49 +08:00
parent 6f91a59d0b
commit 0a78fb7102
12 changed files with 156 additions and 117 deletions

View File

@@ -431,8 +431,7 @@ int mpi_dec_test_decode(MpiDecTestCmd *cmd)
MpiCmd mpi_cmd = MPP_CMD_BASE;
MppParam param = NULL;
RK_U32 need_split = 1;
RK_U32 output_block = MPP_POLL_BLOCK;
RK_S64 block_timeout = cmd->timeout;
MppPollType timeout = cmd->timeout;
// paramter for resource malloc
RK_U32 width = cmd->width;
@@ -553,18 +552,15 @@ int mpi_dec_test_decode(MpiDecTestCmd *cmd)
goto MPP_TEST_OUT;
}
if (block_timeout) {
param = &output_block;
ret = mpi->control(ctx, MPP_SET_OUTPUT_BLOCK, param);
// NOTE: timeout value please refer to MppPollType definition
// 0 - non-block call (default)
// -1 - block call
// +val - timeout value in ms
if (timeout) {
param = &timeout;
ret = mpi->control(ctx, MPP_SET_OUTPUT_TIMEOUT, param);
if (MPP_OK != ret) {
mpp_err("Failed to set blocking mode on MPI (code = %d).\n", ret);
goto MPP_TEST_OUT;
}
param = &block_timeout;
ret = mpi->control(ctx, MPP_SET_OUTPUT_BLOCK_TIMEOUT, param);
if (MPP_OK != ret) {
mpp_err("Failed to set blocking mode on MPI (code = %d).\n", ret);
mpp_err("Failed to set output timeout %d ret %d\n", timeout, ret);
goto MPP_TEST_OUT;
}
}