mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-04 08:46:24 +08:00
[test]: Add output block for mpi_enc_test
Set encoder output to block mode in mpi_enc_test. In some case the demo will get NULL return packet. Use block mode to avoid this error. Change-Id: I8e7438b07f024a30f62bbb92382e210b06e47a61 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -406,6 +406,8 @@ MPP_RET test_mpp_run(MpiEncTestData *p)
|
||||
goto RET;
|
||||
}
|
||||
|
||||
mpp_assert(packet);
|
||||
|
||||
if (packet) {
|
||||
// write packet to file here
|
||||
void *ptr = mpp_packet_get_pos(packet);
|
||||
@@ -443,6 +445,7 @@ int mpi_enc_test(MpiEncTestCmd *cmd)
|
||||
{
|
||||
MPP_RET ret = MPP_OK;
|
||||
MpiEncTestData *p = NULL;
|
||||
MppPollType timeout = MPP_POLL_BLOCK;
|
||||
|
||||
mpp_log("mpi_enc_test start\n");
|
||||
|
||||
@@ -468,6 +471,12 @@ int mpi_enc_test(MpiEncTestCmd *cmd)
|
||||
goto MPP_TEST_OUT;
|
||||
}
|
||||
|
||||
ret = p->mpi->control(p->ctx, MPP_SET_OUTPUT_TIMEOUT, &timeout);
|
||||
if (MPP_OK != ret) {
|
||||
mpp_err("mpi control set output timeout %d ret %d\n", timeout, ret);
|
||||
goto MPP_TEST_OUT;
|
||||
}
|
||||
|
||||
ret = mpp_init(p->ctx, MPP_CTX_ENC, p->type);
|
||||
if (ret) {
|
||||
mpp_err("mpp_init failed ret %d\n", ret);
|
||||
|
Reference in New Issue
Block a user