From 558822acbb1b2a02c22979f22ef3fe928ef564f5 Mon Sep 17 00:00:00 2001 From: Dimitar Borisov Date: Wed, 3 Oct 2012 15:19:30 +0300 Subject: camera_test: Return status of scripts execution If a script being executed complete successfully, main function return 0. If not, main function returns different form 0. When executing script and get mmu fault from ducati, camera is restarted and if the mmu fault is still present camera will be restarted 3 more times and will return status different from 0. Change-Id: I07820f90b15d950c1e8dfd7f40726881ac7af9ac Signed-off-by: Dimitar Borisov --- test/CameraHal/camera_test_menu.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index a3c55b6..51edcf1 100644 --- a/test/CameraHal/camera_test_menu.cpp +++ b/test/CameraHal/camera_test_menu.cpp @@ -3711,7 +3711,7 @@ int functional_menu() { stopPreview(); deleteAllocatedMemory(); - return -1; + return 0; case '/': { @@ -3785,7 +3785,7 @@ int functional_menu() { break; } - return 0; + return 1; } void print_usage() { @@ -4248,10 +4248,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; } @@ -4263,7 +4265,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; } @@ -4272,6 +4275,10 @@ int runRegressionTest(cmd_args_t *cmd_args) { free(cmd); cmd = NULL; + 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; @@ -4288,11 +4295,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; } @@ -4300,12 +4308,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() { -- cgit v1.1 From f31faef4c309412049a5916e002ec4d1cf32a958 Mon Sep 17 00:00:00 2001 From: Dimitar Borisov Date: Thu, 23 Aug 2012 14:34:20 +0300 Subject: camera_test: Camera test handling of Ducati exceptions Fixes an issue with Ducati exeptions handling Change-Id: I3508b846968191d0be0a606b3b02119ba6c06d42 Signed-off-by: Dimitar Borisov --- test/CameraHal/camera_test_menu.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index 51edcf1..c4e8ec9 100644 --- a/test/CameraHal/camera_test_menu.cpp +++ b/test/CameraHal/camera_test_menu.cpp @@ -858,9 +858,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 +870,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(); @@ -4014,6 +4012,7 @@ int restartCamera() { printf("+++Restarting Camera After Error+++\n"); stopPreview(); + closeCamera(); if (recordingMode) { stopRecording(); -- cgit v1.1 From d1e01a97370fadea6cacc300f0fd0c6e5e89fae2 Mon Sep 17 00:00:00 2001 From: Dimitar Borisov Date: Thu, 23 Aug 2012 17:49:32 +0300 Subject: camera_test: Iteration count for all scripts Iteration counter is added that is incremented on every new line form the script. Change-Id: Ie5d5cf63c326aa781bf5d2edc95f1ad57f32feb3 Signed-off-by: Dimitar Borisov --- test/CameraHal/camera_test_menu.cpp | 3 +++ test/CameraHal/camera_test_script.cpp | 14 ++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'test') diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index c4e8ec9..e72bcd7 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; @@ -4274,6 +4276,7 @@ int runRegressionTest(cmd_args_t *cmd_args) { free(cmd); cmd = NULL; + iterationCount = 0; restartTestCount ++; if(restartTestCount > 3) { return res; 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'))) { -- cgit v1.1 From 6512141186a7ec37f93b1a52449fc3a47011dfee Mon Sep 17 00:00:00 2001 From: Dimitar Borisov Date: Fri, 12 Oct 2012 16:48:50 +0300 Subject: camera_test: Fix for disconnect and reconnect to camera [Problem] Currently when try to disconnect and reconnect to camera using "@" command, segmentation fault is seen. This is happening because when open camera, some of the parameters are not set to valid valiues when setParameters function is called. [Solution] When get parameters form capabilities, initDefaults() function is called to set all the parameters to the default values and then setParameters is called. Change-Id: Icd49ca6286b92badec9c302c966263139aa204f3 Signed-off-by: Dimitar Borisov --- test/CameraHal/camera_test_menu.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index e72bcd7..7ff0155 100644 --- a/test/CameraHal/camera_test_menu.cpp +++ b/test/CameraHal/camera_test_menu.cpp @@ -1293,6 +1293,7 @@ int openCamera() { } getParametersFromCapabilities(); getSizeParametersFromCapabilities(); + initDefaults(); camera->setParameters(params.flatten()); camera->setListener(new CameraHandler()); -- cgit v1.1 From ebeed535da70400ffe92a21e2691c44b6a986714 Mon Sep 17 00:00:00 2001 From: Dimitar Borisov Date: Fri, 12 Oct 2012 17:31:23 +0300 Subject: camera_test: Fix for crash with video recoring in 1080p When in portrait mode height is changed form 1080 to 1088 because 1080 is not supported. Change-Id: I40531d58c206b4682c1fbed58d21c4f08550f3a7 Signed-off-by: Dimitar Borisov --- test/CameraHal/camera_test_menu.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index 7ff0155..0c961ca 100644 --- a/test/CameraHal/camera_test_menu.cpp +++ b/test/CameraHal/camera_test_menu.cpp @@ -1162,6 +1162,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; -- cgit v1.1