diff options
author | Jeong-Seok Yang <jseok.yang@samsung.com> | 2011-01-21 21:56:50 +0900 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-01-27 14:37:09 -0800 |
commit | 68733d5982bc905c9668547659d84e75a908a996 (patch) | |
tree | f827f25637b657e8f96eb4cf95e668f5553eda9d | |
parent | 81a2d1d7d66d1aaf17c326948d0d1eafb993c957 (diff) | |
download | device_samsung_crespo-68733d5982bc905c9668547659d84e75a908a996.zip device_samsung_crespo-68733d5982bc905c9668547659d84e75a908a996.tar.gz device_samsung_crespo-68733d5982bc905c9668547659d84e75a908a996.tar.bz2 |
libcamera: Add lock for recording video
bug fix: Flag about recording video was used without locking.
So, It was occured a error when recording stops.
Change-Id: Ie19ec12d17a5a70e44f5ca8743e8ae5672c16a34
Signed-off-by: Jeong-Seok Yang <jseok.yang@samsung.com>
-rw-r--r-- | libcamera/SecCameraHWInterface.cpp | 5 | ||||
-rw-r--r-- | libcamera/SecCameraHWInterface.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index 7e36a9d..50d43a0 100644 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -510,6 +510,7 @@ int CameraHardwareSec::previewThread() mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, mCallbackCookie); } + Mutex::Autolock lock(mRecordLock); if (mRecordRunning == true) { index = mSecCamera->getRecordFrame(); if (index < 0) { @@ -684,6 +685,8 @@ status_t CameraHardwareSec::startRecording() { LOGV("%s :", __func__); + Mutex::Autolock lock(mRecordLock); + if (mRecordRunning == false) { if (mSecCamera->startRecord() < 0) { LOGE("ERR(%s):Fail on mSecCamera->startRecord()", __func__); @@ -698,6 +701,8 @@ void CameraHardwareSec::stopRecording() { LOGV("%s :", __func__); + Mutex::Autolock lock(mRecordLock); + if (mRecordRunning == true) { if (mSecCamera->stopRecord() < 0) { LOGE("ERR(%s):Fail on mSecCamera->stopRecord()", __func__); diff --git a/libcamera/SecCameraHWInterface.h b/libcamera/SecCameraHWInterface.h index 724d1bc..75526c6 100644 --- a/libcamera/SecCameraHWInterface.h +++ b/libcamera/SecCameraHWInterface.h @@ -201,6 +201,7 @@ private: int32_t mMsgEnabled; bool mRecordRunning; + mutable Mutex mRecordLock; int mPostViewWidth; int mPostViewHeight; int mPostViewSize; |