diff options
author | Sundar Raman <sunds@ti.com> | 2011-09-29 17:54:31 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-10-07 16:05:19 -0700 |
commit | 88006b1ebee79cb0f1a2c682258b313eb801049d (patch) | |
tree | ab834046918037fa43dea89536dc94f185e76351 /camera/BaseCameraAdapter.cpp | |
parent | 34da992571ff2af3274d2e3fcaaadf6383c83996 (diff) | |
download | hardware_ti_omap4xxx-88006b1ebee79cb0f1a2c682258b313eb801049d.tar.gz hardware_ti_omap4xxx-88006b1ebee79cb0f1a2c682258b313eb801049d.tar.bz2 hardware_ti_omap4xxx-88006b1ebee79cb0f1a2c682258b313eb801049d.zip |
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/BaseCameraAdapter.cpp')
-rw-r--r-- | camera/BaseCameraAdapter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/camera/BaseCameraAdapter.cpp b/camera/BaseCameraAdapter.cpp index fd051e5..9670e4c 100644 --- a/camera/BaseCameraAdapter.cpp +++ b/camera/BaseCameraAdapter.cpp @@ -411,13 +411,13 @@ status_t BaseCameraAdapter::sendCommand(CameraCommands operation, int value1, in mPreviewDataBuffersAvailable.clear(); for ( uint32_t i = 0 ; i < desc->mMaxQueueable ; i++ ) { - mPreviewDataBuffersAvailable.add(mPreviewDataBuffers[i], true); + mPreviewDataBuffersAvailable.add(mPreviewDataBuffers[i], 0); } // initial ref count for undeqeueued buffers is 1 since buffer provider // is still holding on to it for ( uint32_t i = desc->mMaxQueueable ; i < desc->mCount ; i++ ) { - mPreviewDataBuffersAvailable.add(mPreviewBuffers[i], 1); + mPreviewDataBuffersAvailable.add(mPreviewDataBuffers[i], 1); } } @@ -464,13 +464,13 @@ status_t BaseCameraAdapter::sendCommand(CameraCommands operation, int value1, in mCaptureBuffersAvailable.clear(); for ( uint32_t i = 0 ; i < desc->mMaxQueueable ; i++ ) { - mCaptureBuffersAvailable.add(mCaptureBuffers[i], true); + mCaptureBuffersAvailable.add(mCaptureBuffers[i], 0); } // initial ref count for undeqeueued buffers is 1 since buffer provider // is still holding on to it for ( uint32_t i = desc->mMaxQueueable ; i < desc->mCount ; i++ ) { - mCaptureBuffersAvailable.add(mPreviewBuffers[i], 1); + mCaptureBuffersAvailable.add(mCaptureBuffers[i], 1); } } @@ -1821,6 +1821,7 @@ status_t BaseCameraAdapter::setState(CameraCommands operation) switch ( operation ) { case CAMERA_STOP_IMAGE_CAPTURE: + case CAMERA_STOP_BRACKET_CAPTURE: CAMHAL_LOGDB("Adapter state switch CAPTURE_STATE->PREVIEW_STATE event = 0x%x", operation); mNextState = PREVIEW_STATE; @@ -1841,6 +1842,7 @@ status_t BaseCameraAdapter::setState(CameraCommands operation) switch ( operation ) { + case CAMERA_STOP_IMAGE_CAPTURE: case CAMERA_STOP_BRACKET_CAPTURE: CAMHAL_LOGDB("Adapter state switch BRACKETING_STATE->PREVIEW_STATE event = 0x%x", operation); |