aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2015-04-24 14:56:54 -0500
committerBuddy Liong2015-04-24 16:26:12 -0500
commit7d0014c9c89b71fe91175b78fc3cfc26829b2a9d (patch)
tree733f3f2d68b32811b93688bd0a0e668894031290
parent565e6707f3ac1466d72b52909a903133503d48e7 (diff)
downloadrepo-libdce-7d0014c9c89b71fe91175b78fc3cfc26829b2a9d.tar.gz
repo-libdce-7d0014c9c89b71fe91175b78fc3cfc26829b2a9d.tar.xz
repo-libdce-7d0014c9c89b71fe91175b78fc3cfc26829b2a9d.zip
[DCE_ENC_TEST] Handling other errors from VIDENC2_process
Currently dce_enc_test is only handling XDM_ERROR only. If VIDENC2_process return with other than XDM_ERROR for example, MmRpc_call is failing because IPU2 has crashed. Currently dce_enc_test is not exiting because it is not handling the error. Change-Id: I7fc4b7306f36961e4582dd5504b0acc4eb2a09a4 Signed-off-by: Buddy Liong <buddy.budiono@ti.com>
-rw-r--r--test_qnx/dce_enc_test/dce_enc_test.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/test_qnx/dce_enc_test/dce_enc_test.c b/test_qnx/dce_enc_test/dce_enc_test.c
index 092703a..dc399fb 100644
--- a/test_qnx/dce_enc_test/dce_enc_test.c
+++ b/test_qnx/dce_enc_test/dce_enc_test.c
@@ -1388,7 +1388,7 @@ int main(int argc, char * *argv)
1388 err = VIDENC2_process(codec, inBufs, outBufs, (VIDENC2_InArgs *) h264enc_inArgs, (VIDENC2_OutArgs *) h264enc_outArgs); 1388 err = VIDENC2_process(codec, inBufs, outBufs, (VIDENC2_InArgs *) h264enc_inArgs, (VIDENC2_OutArgs *) h264enc_outArgs);
1389 DEBUG("[DCE_ENC_TEST] VIDENC2_process - err %d", err); 1389 DEBUG("[DCE_ENC_TEST] VIDENC2_process - err %d", err);
1390 1390
1391 if( err < 0 ) { 1391 if( err == DCE_EXDM_FAIL ) {
1392 int i = 0; 1392 int i = 0;
1393 1393
1394 for( i=0; i < IH264ENC_EXTERROR_NUM_MAXWORDS; i++ ) { 1394 for( i=0; i < IH264ENC_EXTERROR_NUM_MAXWORDS; i++ ) {
@@ -1404,23 +1404,21 @@ int main(int argc, char * *argv)
1404 1404
1405 if( XDM_ISFATALERROR(h264enc_outArgs->videnc2OutArgs.extendedError) ) { 1405 if( XDM_ISFATALERROR(h264enc_outArgs->videnc2OutArgs.extendedError) ) {
1406 ERROR("process returned error: %d\n", err); 1406 ERROR("process returned error: %d\n", err);
1407 //ERROR("extendedError: %08x", outArgs->extendedError);
1408 ERROR("extendedError: %08x", h264enc_outArgs->videnc2OutArgs.extendedError); 1407 ERROR("extendedError: %08x", h264enc_outArgs->videnc2OutArgs.extendedError);
1409 ERROR("DCE_ENCODE_TEST_FAIL: CODEC FATAL ERROR"); 1408 ERROR("DCE_ENCODE_TEST_FAIL: CODEC FATAL ERROR");
1410 goto shutdown; 1409 goto shutdown;
1411 } else if( eof ) { 1410 } else if( eof ) {
1412 //ERROR("Codec_process returned err=%d, extendedError=%08x", err, outArgs->extendedError);
1413 ERROR("Codec_process returned err=%d, extendedError=%08x", err, h264enc_outArgs->videnc2OutArgs.extendedError); 1411 ERROR("Codec_process returned err=%d, extendedError=%08x", err, h264enc_outArgs->videnc2OutArgs.extendedError);
1414 err = XDM_EFAIL; 1412 DEBUG("-------------------- Flush completed------------------------");
1415
1416 if( err == XDM_EFAIL ) {
1417 DEBUG("-------------------- Flush completed------------------------");
1418 }
1419 } else { 1413 } else {
1420 //DEBUG("Non-fatal err=%d, extendedError=%08x", err, outArgs->extendedError);
1421 DEBUG("Non-fatal err=%d, h264enc_outArgs->videnc2OutArgs.extendedError=%08x ", err, h264enc_outArgs->videnc2OutArgs.extendedError); 1414 DEBUG("Non-fatal err=%d, h264enc_outArgs->videnc2OutArgs.extendedError=%08x ", err, h264enc_outArgs->videnc2OutArgs.extendedError);
1422 err = XDM_EOK; 1415 err = XDM_EOK;
1423 } 1416 }
1417 } else if(( err == DCE_EXDM_UNSUPPORTED ) ||
1418 ( err == DCE_EIPC_CALL_FAIL ) ||
1419 ( err == DCE_EINVALID_INPUT )) {
1420 ERROR("DCE_ENCODE_TEST_FAIL: VIDENC2_process return err %d", err);
1421 goto shutdown;
1424 } 1422 }
1425 1423
1426 DEBUG("bytesGenerated %d", h264enc_outArgs->videnc2OutArgs.bytesGenerated); 1424 DEBUG("bytesGenerated %d", h264enc_outArgs->videnc2OutArgs.bytesGenerated);
@@ -1429,11 +1427,27 @@ int main(int argc, char * *argv)
1429 DEBUG("[DCE_ENC_TEST] codec %p inBufs %p outBufs %p mpeg4enc_inArgs %p mpeg4enc_outArgs %p", codec, inBufs, outBufs, mpeg4enc_inArgs, mpeg4enc_outArgs); 1427 DEBUG("[DCE_ENC_TEST] codec %p inBufs %p outBufs %p mpeg4enc_inArgs %p mpeg4enc_outArgs %p", codec, inBufs, outBufs, mpeg4enc_inArgs, mpeg4enc_outArgs);
1430 err = VIDENC2_process(codec, inBufs, outBufs, (VIDENC2_InArgs *) mpeg4enc_inArgs, (VIDENC2_OutArgs *) mpeg4enc_outArgs); 1428 err = VIDENC2_process(codec, inBufs, outBufs, (VIDENC2_InArgs *) mpeg4enc_inArgs, (VIDENC2_OutArgs *) mpeg4enc_outArgs);
1431 DEBUG("[DCE_ENC_TEST] VIDENC2_process - err %d", err); 1429 DEBUG("[DCE_ENC_TEST] VIDENC2_process - err %d", err);
1432 if( err < 0 ) { 1430 if( err == DCE_EXDM_FAIL ) {
1433 //TODO error handling on MPEG4/H.263
1434 ERROR("DCE_ENCODE_TEST_FAIL: CODEC PROCESS RETURNED ERROR : err=%d, extendedError=%08x", err, mpeg4enc_outArgs->videnc2OutArgs.extendedError); 1431 ERROR("DCE_ENCODE_TEST_FAIL: CODEC PROCESS RETURNED ERROR : err=%d, extendedError=%08x", err, mpeg4enc_outArgs->videnc2OutArgs.extendedError);
1435 goto shutdown; 1432 if( XDM_ISFATALERROR(mpeg4enc_outArgs->videnc2OutArgs.extendedError) ) {
1433 ERROR("process returned error: %d\n", err);
1434 ERROR("extendedError: %08x", mpeg4enc_outArgs->videnc2OutArgs.extendedError);
1435 ERROR("DCE_ENCODE_TEST_FAIL: CODEC FATAL ERROR");
1436 goto shutdown;
1437 } else if( eof ) {
1438 ERROR("Codec_process returned err=%d, extendedError=%08x", err, mpeg4enc_outArgs->videnc2OutArgs.extendedError);
1439 DEBUG("-------------------- Flush completed------------------------");
1440 } else {
1441 DEBUG("Non-fatal err=%d, mpeg4enc_outArgs->videnc2OutArgs.extendedError=%08x ", err, mpeg4enc_outArgs->videnc2OutArgs.extendedError);
1442 err = XDM_EOK;
1443 }
1444 } else if(( err == DCE_EXDM_UNSUPPORTED ) ||
1445 ( err == DCE_EIPC_CALL_FAIL ) ||
1446 ( err == DCE_EINVALID_INPUT )) {
1447 ERROR("DCE_ENCODE_TEST_FAIL: VIDENC2_process return err %d", err);
1448 goto shutdown;
1436 } 1449 }
1450
1437 DEBUG("\n bytesGenerated %d", mpeg4enc_outArgs->videnc2OutArgs.bytesGenerated); 1451 DEBUG("\n bytesGenerated %d", mpeg4enc_outArgs->videnc2OutArgs.bytesGenerated);
1438 bytesGenerated = mpeg4enc_outArgs->videnc2OutArgs.bytesGenerated; 1452 bytesGenerated = mpeg4enc_outArgs->videnc2OutArgs.bytesGenerated;
1439 } 1453 }