From 6cd6e6f0f952d68e0301b58f7c77422448f51730 Mon Sep 17 00:00:00 2001 From: Akwasi Boateng Date: Fri, 30 Sep 2011 13:39:31 -0500 Subject: omap4xxx: camera: switch to executing state when surface is null Partial fix for b/5422679 To enhance standby to first shot performance Change-Id: Ib32e8120a7908419c76e8cf2f1830f0667b258c0 Signed-off-by: Akwasi Boateng Signed-off-by: Iliyan Malchev --- camera/inc/BaseCameraAdapter.h | 2 ++ camera/inc/CameraHal.h | 1 + camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 9 ++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'camera/inc') diff --git a/camera/inc/BaseCameraAdapter.h b/camera/inc/BaseCameraAdapter.h index c205b3c..a11ea1d 100644 --- a/camera/inc/BaseCameraAdapter.h +++ b/camera/inc/BaseCameraAdapter.h @@ -135,6 +135,8 @@ protected: // ( if supported ) virtual status_t stopFaceDetection(); + virtual status_t switchToExecuting(); + // Receive orientation events from CameraHal virtual void onOrientationEvent(uint32_t orientation, uint32_t tilt); diff --git a/camera/inc/CameraHal.h b/camera/inc/CameraHal.h index 3ca9ed7..68f5cac 100644 --- a/camera/inc/CameraHal.h +++ b/camera/inc/CameraHal.h @@ -755,6 +755,7 @@ public: CAMERA_TIMEOUT_EXPIRED = 21, CAMERA_START_FD = 22, CAMERA_STOP_FD = 23, + CAMERA_SWITCH_TO_EXECUTING = 24, }; enum CameraMode diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h index 6701aa6..960846e 100644 --- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h +++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h @@ -398,10 +398,13 @@ protected: virtual status_t getFrameDataSize(size_t &dataFrameSize, size_t bufferCount); virtual status_t startFaceDetection(); virtual status_t stopFaceDetection(); + virtual status_t switchToExecuting(); virtual void onOrientationEvent(uint32_t orientation, uint32_t tilt); private: + status_t doSwitchToExecuting(); + void performCleanupAfterError(); status_t switchToLoaded(); @@ -630,7 +633,8 @@ private: enum { COMMAND_EXIT = -1, CAMERA_START_IMAGE_CAPTURE = 0, - CAMERA_PERFORM_AUTOFOCUS + CAMERA_PERFORM_AUTOFOCUS = 1, + CAMERA_SWITCH_TO_EXECUTING }; private: @@ -846,6 +850,9 @@ private: Semaphore mStartCaptureSem; Semaphore mStopCaptureSem; Semaphore mSwitchToLoadedSem; + Semaphore mSwitchToExecSem; + + mutable Mutex mSwitchToExecLock; Vector mEventSignalQ; Mutex mEventLock; -- cgit v1.1