diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-07-14 06:51:16 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-07-15 05:47:30 +0800 |
commit | a0d3ac57a9f9a933c21e554abe48d9249c49530b (patch) | |
tree | 3c7e365df9733f98cfead4be4c5619eab4548954 /libcamera/SecCameraHWInterface.h | |
parent | c7b08ce83e0fc255ca785788e2cac827ef88dbda (diff) | |
download | device_samsung_crespo-a0d3ac57a9f9a933c21e554abe48d9249c49530b.zip device_samsung_crespo-a0d3ac57a9f9a933c21e554abe48d9249c49530b.tar.gz device_samsung_crespo-a0d3ac57a9f9a933c21e554abe48d9249c49530b.tar.bz2 |
libcamera: Fix a synchronization bug
It is valid for the app to call setParameter from jpeg callback.
But mCaptureInProgress may still be true. Now startPreview,
takePicture, and setParameters wait for mCaptureInProgress up to
5 secodns.
bug:3362253
Change-Id: If1935fdbba29e49be8334e2dd92f7ae9ac93ac4a
Diffstat (limited to 'libcamera/SecCameraHWInterface.h')
-rw-r--r-- | libcamera/SecCameraHWInterface.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libcamera/SecCameraHWInterface.h b/libcamera/SecCameraHWInterface.h index 6b10b6b..a081090 100644 --- a/libcamera/SecCameraHWInterface.h +++ b/libcamera/SecCameraHWInterface.h @@ -95,7 +95,6 @@ private: mHardware(hw) { } virtual bool threadLoop() { mHardware->pictureThread(); - mHardware->mSecCamera->endSnapshot(); return false; } }; @@ -156,6 +155,7 @@ private: const int height) const; bool isSupportedParameter(const char * const parm, const char * const supported_parm) const; + status_t waitCaptureCompletion(); /* used by auto focus thread to block until it's told to run */ mutable Mutex mFocusLock; mutable Condition mFocusCondition; @@ -171,8 +171,9 @@ private: preview_stream_ops *mPreviewWindow; - /* used to guard threading state */ - mutable Mutex mStateLock; + /* used to guard mCaptureInProgress */ + mutable Mutex mCaptureLock; + mutable Condition mCaptureCondition; CameraParameters mParameters; CameraParameters mInternalParameters; |