summaryrefslogtreecommitdiffstats
path: root/camera/CameraHal.cpp
diff options
context:
space:
mode:
authorSundar Raman <sunds@ti.com>2011-09-29 17:54:31 -0700
committerIliyan Malchev <malchev@google.com>2011-10-07 16:05:19 -0700
commit88006b1ebee79cb0f1a2c682258b313eb801049d (patch)
treeab834046918037fa43dea89536dc94f185e76351 /camera/CameraHal.cpp
parent34da992571ff2af3274d2e3fcaaadf6383c83996 (diff)
downloadhardware_ti_omap4xxx-88006b1ebee79cb0f1a2c682258b313eb801049d.zip
hardware_ti_omap4xxx-88006b1ebee79cb0f1a2c682258b313eb801049d.tar.gz
hardware_ti_omap4xxx-88006b1ebee79cb0f1a2c682258b313eb801049d.tar.bz2
omap4xxx: camera: various fixes
clean up resources properly on exit: - Frees all resources in case of error during preview buffer allocation in ANativeDisplayAdadapter. - Fixes a couple of typos in BaseCameraAdapter. - Removes a possible memory leak during temporal bracketing. 'stopBracketing()' will never get properly executed when 'startImageCapture()' disables 'mBracketingEnabled'. - Stops temporal bracketing properly inside 'signalEndImageCapture()'. Change-Id: Ic122058c835e30f12f335a288164475b8f6d1c6d Signed-off-by: Emilian Peev <epeev@mm-sol.com> Signed-off-by: Sundar Raman <sunds@ti.com> Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'camera/CameraHal.cpp')
-rw-r--r--camera/CameraHal.cpp29
1 files changed, 9 insertions, 20 deletions
diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp
index 8556a31..ee8267c 100644
--- a/camera/CameraHal.cpp
+++ b/camera/CameraHal.cpp
@@ -1301,7 +1301,11 @@ status_t CameraHal::signalEndImageCapture()
LOG_FUNCTION_NAME;
- mCameraAdapter->sendCommand(CameraAdapter::CAMERA_STOP_IMAGE_CAPTURE);
+ if ( mBracketingRunning ) {
+ stopImageBracketing();
+ } else {
+ mCameraAdapter->sendCommand(CameraAdapter::CAMERA_STOP_IMAGE_CAPTURE);
+ }
LOG_FUNCTION_NAME_EXIT;
@@ -2378,25 +2382,14 @@ status_t CameraHal::stopImageBracketing()
LOG_FUNCTION_NAME;
- if ( !mBracketingRunning )
- {
- return ret;
- }
-
- if ( NO_ERROR == ret )
- {
- mBracketingRunning = false;
- }
-
- if(!previewEnabled() && !mDisplayPaused)
+ if( !previewEnabled() )
{
return NO_INIT;
}
- if ( NO_ERROR == ret )
- {
- ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_STOP_BRACKET_CAPTURE);
- }
+ mBracketingRunning = false;
+
+ ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_STOP_BRACKET_CAPTURE);
LOG_FUNCTION_NAME_EXIT;
@@ -2550,10 +2543,6 @@ status_t CameraHal::takePicture( )
( int ) &desc);
}
}
- else
- {
- mBracketingRunning = false;
- }
if ( ( NO_ERROR == ret ) && ( NULL != mCameraAdapter ) )
{