diff options
author | Daniel Levin <dendy@ti.com> | 2012-12-05 15:47:26 +0200 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-12-05 15:47:36 +0200 |
commit | cf3c3da0c0b2b033cd3b6aa9835a5b1559110fd0 (patch) | |
tree | 23f81abc13ac7a3bc95050bef451998ca4f072b8 /test | |
parent | fea025262821c36c01440fadd68343a5ddd873d6 (diff) | |
parent | 13e5f4171777082bf00f48dae3de45522406198e (diff) | |
download | hardware_ti_omap4-cf3c3da0c0b2b033cd3b6aa9835a5b1559110fd0.zip hardware_ti_omap4-cf3c3da0c0b2b033cd3b6aa9835a5b1559110fd0.tar.gz hardware_ti_omap4-cf3c3da0c0b2b033cd3b6aa9835a5b1559110fd0.tar.bz2 |
Merge branch 'd-jb-mr0-release-camera' into p-jb-mr1-release
Change-Id: I3feec53fce7f847398420b89e2e8cc2b1045cca3
Signed-off-by: Daniel Levin <dendy@ti.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/CameraHal/camera_test_menu.cpp | 39 | ||||
-rw-r--r-- | test/CameraHal/camera_test_script.cpp | 14 |
2 files changed, 41 insertions, 12 deletions
diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index ab0d830..3de29b9 100644 --- a/test/CameraHal/camera_test_menu.cpp +++ b/test/CameraHal/camera_test_menu.cpp @@ -189,6 +189,8 @@ param_Array ** Vcapture_Array = 0; param_Array ** preview_Array = 0; param_Array ** thumbnail_Array = 0; fps_Array * fpsArray = 0; +int iterationCount = 1; +bool iterationPrint = true; int enableMisalignmentCorrectionIdx = 0; @@ -858,9 +860,7 @@ void CameraHandler::notify(int32_t msgType, int32_t ext1, int32_t ext2) { if ( msgType & CAMERA_MSG_SHUTTER ) printf("Shutter done in %llu us\n", timeval_delay(&picture_start)); - - if ( msgType & CAMERA_MSG_ERROR && (ext1 == 1)) - { + if ( msgType == 1) { printf("Camera Test CAMERA_MSG_ERROR.....\n"); if (stressTest) { @@ -872,7 +872,7 @@ void CameraHandler::notify(int32_t msgType, int32_t ext1, int32_t ext2) { printf("Camera Test Notified of Error Stopping.....\n"); stopScript =false; stopPreview(); - + closeCamera(); if (recordingMode) { stopRecording(); @@ -1165,6 +1165,9 @@ int configureRecorder() { recording_counter++; if (cameraInfo.orientation == 90 || cameraInfo.orientation == 270 ) { + if (Vcapture_Array[VcaptureSizeIDX]->height == 1080) { + Vcapture_Array[VcaptureSizeIDX]->height = 1088; + } if ( recorder->setVideoSize(Vcapture_Array[VcaptureSizeIDX]->height, Vcapture_Array[VcaptureSizeIDX]->width) < 0 ) { printf("error while configuring video size\n"); return -1; @@ -1296,6 +1299,7 @@ int openCamera() { } getParametersFromCapabilities(); getSizeParametersFromCapabilities(); + initDefaults(); camera->setParameters(params.flatten()); camera->setListener(new CameraHandler()); @@ -3714,7 +3718,7 @@ int functional_menu() { stopPreview(); deleteAllocatedMemory(); - return -1; + return 0; case '/': { @@ -3788,7 +3792,7 @@ int functional_menu() { break; } - return 0; + return 1; } void print_usage() { @@ -4017,6 +4021,7 @@ int restartCamera() { printf("+++Restarting Camera After Error+++\n"); stopPreview(); + closeCamera(); if (recordingMode) { stopRecording(); @@ -4251,10 +4256,12 @@ int startTest() { int runRegressionTest(cmd_args_t *cmd_args) { char *cmd; int pid; + int res = 0; + int restartTestCount = 0; platformID = cmd_args->platform_id; - int res = startTest(); + res = startTest(); if (res != 0) { return res; } @@ -4266,7 +4273,8 @@ int runRegressionTest(cmd_args_t *cmd_args) { stressTest = true; while (1) { - if (execute_functional_script(cmd) == 0) { + res = execute_functional_script(cmd); + if (res >= 0) { break; } @@ -4275,6 +4283,11 @@ int runRegressionTest(cmd_args_t *cmd_args) { free(cmd); cmd = NULL; + iterationCount = 0; + restartTestCount ++; + if(restartTestCount > 3) { + return res; + } if ( (restartCamera() != 0) || ((cmd = load_script(cmd_args->script_file_name)) == NULL) ) { printf("ERROR::CameraTest Restarting Camera...\n"); res = -1; @@ -4291,11 +4304,12 @@ int runRegressionTest(cmd_args_t *cmd_args) { stop_logging(cmd_args->logging, pid); } - return 0; + return res; } int runFunctionalTest() { - int res = startTest(); + int res = 0; + res = startTest(); if (res != 0) { return res; } @@ -4303,12 +4317,13 @@ int runFunctionalTest() { print_menu = 1; while (1) { - if (functional_menu() < 0) { + res = functional_menu(); + if (res <= 0) { break; } } - return 0; + return res; } int runApiTest() { diff --git a/test/CameraHal/camera_test_script.cpp b/test/CameraHal/camera_test_script.cpp index 21ed7e7..4fa2f9f 100644 --- a/test/CameraHal/camera_test_script.cpp +++ b/test/CameraHal/camera_test_script.cpp @@ -171,6 +171,8 @@ extern int manualConvMin ; extern int manualConvMax ; extern bool faceDetectToggle; extern unsigned int burstCount; +extern int iterationCount; +extern bool iterationPrint; /** Buffer source reset */ extern bool bufferSourceInputReset; @@ -185,6 +187,18 @@ void trim_script_cmd(char *cmd) { *c = *(c+1); } } + if (iterationPrint) { + printf("\n==============\n"); + printf("IterationCount: %d", iterationCount); + printf("\n==============\n"); + iterationPrint = false; + } + // Iteration Counter + while ( NULL != (nl = strchr(cmd, '\n')) || NULL != (nl = strchr(cmd, '\r\n'))) { + iterationPrint = true; + iterationCount ++; + break; + } // then remove all single line feed symbols while ( NULL != (nl = strchr(cmd, '\n'))) { |