diff options
author | Jeong-Seok Yang <jseok.yang@samsung.com> | 2011-01-29 08:02:29 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-29 08:02:29 -0800 |
commit | 141384deab44bab1f3fc8dbb245e20ccac0170ea (patch) | |
tree | 850040797b60dab6f501348c9e837c0499391362 /libcamera | |
parent | 50f99ff3c7cfe7f90db786d11eebf503167909a2 (diff) | |
parent | ff93a1bc8935a649893782d24bffa940ba450a2f (diff) | |
download | device_samsung_crespo-141384deab44bab1f3fc8dbb245e20ccac0170ea.zip device_samsung_crespo-141384deab44bab1f3fc8dbb245e20ccac0170ea.tar.gz device_samsung_crespo-141384deab44bab1f3fc8dbb245e20ccac0170ea.tar.bz2 |
am ff93a1bc: am 68733d59: libcamera: Add lock for recording video
* commit 'ff93a1bc8935a649893782d24bffa940ba450a2f':
libcamera: Add lock for recording video
Diffstat (limited to 'libcamera')
-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 85e0c01..fcd8390 100644 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -515,6 +515,7 @@ int CameraHardwareSec::previewThread() mDataCb(CAMERA_MSG_PREVIEW_FRAME, buffer, mCallbackCookie); } + Mutex::Autolock lock(mRecordLock); if (mRecordRunning == true) { index = mSecCamera->getRecordFrame(); if (index < 0) { @@ -689,6 +690,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__); @@ -703,6 +706,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 150de62..e309ae5 100644 --- a/libcamera/SecCameraHWInterface.h +++ b/libcamera/SecCameraHWInterface.h @@ -202,6 +202,7 @@ private: int32_t mMsgEnabled; bool mRecordRunning; + mutable Mutex mRecordLock; int mPostViewWidth; int mPostViewHeight; int mPostViewSize; |