From 7f483836fab38c86abd3fd9ee5d996ac99379674 Mon Sep 17 00:00:00 2001 From: Tyler Luu Date: Thu, 21 Jun 2012 09:50:20 -0500 Subject: CameraHal: Change state machine flow for queuing shots - Instead of having to have CameraHal deal with logic to queue shots, move the code flow to state machine and respective camera adapters, so they can interally handle it. Now call flow for queuing shots and regular capture should be the same from CameraHal perspective. Change-Id: I9a74008aeaabc8dd169c78f6a85201f50580d25c Signed-off-by: Tyler Luu Signed-off-by: Vladimir Petrov --- camera/BaseCameraAdapter.cpp | 13 ++++++++++++- camera/CameraHal.cpp | 15 --------------- 2 files changed, 12 insertions(+), 16 deletions(-) (limited to 'camera') diff --git a/camera/BaseCameraAdapter.cpp b/camera/BaseCameraAdapter.cpp index 06ab313..d40ef61 100644 --- a/camera/BaseCameraAdapter.cpp +++ b/camera/BaseCameraAdapter.cpp @@ -2118,6 +2118,7 @@ status_t BaseCameraAdapter::setState(CameraCommands operation) mNextState = PREVIEW_STATE; break; + case CAMERA_QUERY_BUFFER_SIZE_IMAGE_CAPTURE: case CAMERA_START_IMAGE_CAPTURE: CAMHAL_LOGDB("Adapter state switch CAPTURE_STATE->CAPTURE_STATE event = %s", printState); @@ -2426,13 +2427,23 @@ status_t BaseCameraAdapter::setState(CameraCommands operation) printState); mNextState = PREVIEW_STATE; break; + case CAMERA_QUERY_BUFFER_SIZE_IMAGE_CAPTURE: case CAMERA_START_IMAGE_CAPTURE: - case CAMERA_USE_BUFFERS_REPROCESS: CAMHAL_LOGDB("Adapter state switch REPROCESS_STATE->REPROCESS_STATE event = %s", printState); mNextState = REPROCESS_STATE; break; + case CAMERA_USE_BUFFERS_REPROCESS: + CAMHAL_LOGDB("Adapter state switch REPROCESS_STATE->REPROCESS_STATE event = %s", + printState); + mNextState = LOADED_REPROCESS_STATE; + break; + case CAMERA_USE_BUFFERS_IMAGE_CAPTURE: + CAMHAL_LOGDB("Adapter state switch REPROCESS_STATE->LOADED_CAPTURE_STATE event = %s", + printState); + mNextState = LOADED_CAPTURE_STATE; + break; default: CAMHAL_LOGEB("Adapter state switch REPROCESS_STATE Invalid Op! event = %s", printState); diff --git a/camera/CameraHal.cpp b/camera/CameraHal.cpp index 15966e3..bfb90db 100644 --- a/camera/CameraHal.cpp +++ b/camera/CameraHal.cpp @@ -3288,21 +3288,6 @@ status_t CameraHal::__takePicture(const char *params) // when we remove legacy TI parameters implementation } - // if we are already in the middle of a capture...then we just need - // setParameters and start image capture to queue more shots - if (((mCameraAdapter->getState() & CameraAdapter::CAPTURE_STATE) == - CameraAdapter::CAPTURE_STATE) && - (mCameraAdapter->getNextState() != CameraAdapter::PREVIEW_STATE)) { -#if PPM_INSTRUMENTATION || PPM_INSTRUMENTATION_ABS - //pass capture timestamp along with the camera adapter command - ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_IMAGE_CAPTURE, - (int) &mStartCapture); -#else - ret = mCameraAdapter->sendCommand(CameraAdapter::CAMERA_START_IMAGE_CAPTURE); -#endif - return ret; - } - if ( !mBracketingRunning ) { // if application didn't set burst through android::ShotParameters -- cgit v1.1