From 4bddda5559a25771f4e4a8c44063892f3b8ca4c6 Mon Sep 17 00:00:00 2001 From: Dimitar Borisov Date: Fri, 31 Aug 2012 16:21:36 +0300 Subject: camera_test: Fixed Burst mode and Exposure brack mode Issue: When capture images in Burst mode and Exposure bracketing mode we get only one image. This is happening because of preview restart after every jpeg callback. Solution: Perview is restarted when all the images in burst or exposure bracketing mode are captured. Change-Id: I6bd28d1fabb466ec34b1c68d001971e4fc0aa9c1 Signed-off-by: Dimitar Borisov --- test/CameraHal/camera_test_menu.cpp | 18 ++++++++++++++---- test/CameraHal/camera_test_script.cpp | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/CameraHal/camera_test_menu.cpp b/test/CameraHal/camera_test_menu.cpp index 5c9e0d3..8fdc5fc 100644 --- a/test/CameraHal/camera_test_menu.cpp +++ b/test/CameraHal/camera_test_menu.cpp @@ -95,7 +95,8 @@ int audioCodecIDX = 0; int outputFormatIDX = 0; int contrast = 0; int brightness = 0; -unsigned int burst = 9; +unsigned int burst = 0; +unsigned int burstCount = 0; int sharpness = 0; int iso_mode = 0; int capture_mode = 0; @@ -693,9 +694,15 @@ void my_jpeg_callback(const sp& mem) { LOG_FUNCTION_NAME; - if( strcmp(modevalues[capture_mode], "cp-cam") ) { - //Start preview after capture. - camera->startPreview(); + if( strcmp(modevalues[capture_mode], "cp-cam")) { + if(burstCount > 1) { + burstCount --; + // Restart preview if taking a single capture + // or after the last iteration of burstCount + } else if(burstCount == 0 || burstCount == 1) { + camera->startPreview(); + burstCount = burst; + } } if (mem == NULL) @@ -2210,6 +2217,7 @@ void setExpGainPreset(ShotParameters ¶ms, const char *input, bool force, par printf("relative EV input: \"%s\"\nnumber of relative EV values: %d (%s)\n", input, i, flush ? "reset" : "append"); burst = i; + burstCount = i; params.set(ShotParameters::KEY_BURST, burst); params.set(ShotParameters::KEY_EXP_COMPENSATION, input); params.remove(ShotParameters::KEY_EXP_GAIN_PAIRS); @@ -2225,6 +2233,7 @@ void setExpGainPreset(ShotParameters ¶ms, const char *input, bool force, par printf("absolute exposure,gain input: \"%s\"\nNumber of brackets: %d (%s)\n", input, i, flush ? "reset" : "append"); burst = i; + burstCount = i; params.set(ShotParameters::KEY_BURST, burst); params.set(ShotParameters::KEY_EXP_GAIN_PAIRS, input); params.remove(ShotParameters::KEY_EXP_COMPENSATION); @@ -3031,6 +3040,7 @@ int functional_menu() { } else { burst += BURST_INC; } + burstCount = burst; params.set(KEY_TI_BURST, burst); if ( hardwareActive ) diff --git a/test/CameraHal/camera_test_script.cpp b/test/CameraHal/camera_test_script.cpp index 423203b..c4e2f2e 100644 --- a/test/CameraHal/camera_test_script.cpp +++ b/test/CameraHal/camera_test_script.cpp @@ -169,6 +169,7 @@ extern int manualConv ; extern int manualConvMin ; extern int manualConvMax ; extern bool faceDetectToggle; +extern unsigned int burstCount; void trim_script_cmd(char *cmd) { char *nl, *cr; @@ -843,6 +844,7 @@ int execute_functional_script(char *script) { case '#': params.set(KEY_TI_BURST, atoi(cmd + 1)); + burstCount = atoi(cmd + 1); if ( hardwareActive ) camera->setParameters(params.flatten()); -- cgit v1.2.3