summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camera/ANativeWindowDisplayAdapter.cpp3
-rw-r--r--camera/BaseCameraAdapter.cpp10
-rw-r--r--camera/CameraHal.cpp29
-rw-r--r--camera/OMXCameraAdapter/OMXCapture.cpp32
4 files changed, 31 insertions, 43 deletions
diff --git a/camera/ANativeWindowDisplayAdapter.cpp b/camera/ANativeWindowDisplayAdapter.cpp
index cb325cc..3f13b52 100644
--- a/camera/ANativeWindowDisplayAdapter.cpp
+++ b/camera/ANativeWindowDisplayAdapter.cpp
@@ -678,6 +678,9 @@ void* ANativeWindowDisplayAdapter::allocateBuffer(int width, int height, const c
}
mFramesWithCameraAdapterMap.removeItem((int) mGrallocHandleMap[start]);
}
+
+ freeBuffer(mGrallocHandleMap);
+
CAMHAL_LOGEA("Error occurred, performing cleanup");
if ( NULL != mErrorNotifier.get() )
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);
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 ) )
{
diff --git a/camera/OMXCameraAdapter/OMXCapture.cpp b/camera/OMXCameraAdapter/OMXCapture.cpp
index 54ac670..26c2bbc 100644
--- a/camera/OMXCameraAdapter/OMXCapture.cpp
+++ b/camera/OMXCameraAdapter/OMXCapture.cpp
@@ -583,11 +583,10 @@ status_t OMXCameraAdapter::sendBracketFrames()
if (!mBracketingBuffersQueued[currentBufferIdx] )
{
CameraFrame cameraFrame;
- initCameraFrame(cameraFrame,
- imgCaptureData->mBufferHeader[currentBufferIdx],
- imgCaptureData->mImageType,
- imgCaptureData);
- sendFrame(cameraFrame);
+ sendCallBacks(cameraFrame,
+ imgCaptureData->mBufferHeader[currentBufferIdx],
+ imgCaptureData->mImageType,
+ imgCaptureData);
}
} while ( currentBufferIdx != mLastBracetingBufferIdx );
@@ -687,22 +686,17 @@ status_t OMXCameraAdapter::stopBracketing()
Mutex::Autolock lock(mBracketingLock);
- if ( mBracketingEnabled )
- {
-
- if ( NULL != mBracketingBuffersQueued )
- {
- delete [] mBracketingBuffersQueued;
- }
+ if ( NULL != mBracketingBuffersQueued )
+ {
+ delete [] mBracketingBuffersQueued;
+ }
- ret = stopImageCapture();
+ ret = stopImageCapture();
- mBracketingBuffersQueued = NULL;
- mBracketingEnabled = false;
- mBracketingBuffersQueuedCount = 0;
- mLastBracetingBufferIdx = 0;
-
- }
+ mBracketingBuffersQueued = NULL;
+ mBracketingEnabled = false;
+ mBracketingBuffersQueuedCount = 0;
+ mLastBracetingBufferIdx = 0;
LOG_FUNCTION_NAME_EXIT;