diff options
author | Tyler Luu <tluu@ti.com> | 2011-09-22 13:45:54 -0500 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-09-23 09:01:08 -0700 |
commit | 6e2a15f108fae020da68296e1440bdf887753f12 (patch) | |
tree | ca2a662981578948b08eedc48b94c12cd8e9e817 /camera | |
parent | 4227bd0e99b446e5dc177f37b8dadf9a5bd6de48 (diff) | |
download | hardware_ti_omap4-6e2a15f108fae020da68296e1440bdf887753f12.zip hardware_ti_omap4-6e2a15f108fae020da68296e1440bdf887753f12.tar.gz hardware_ti_omap4-6e2a15f108fae020da68296e1440bdf887753f12.tar.bz2 |
CameraHal: Add metering area mutex
mMeteringAreas needs to be protected by a mutex so
it's not cleared or modified while setting it
Ducati.
Change-Id: I0ca8f5e3b57b88b518a8e1ab22c442c21131e39c
Signed-off-by: Tyler Luu <tluu@ti.com>
Diffstat (limited to 'camera')
-rw-r--r-- | camera/OMXCameraAdapter/OMX3A.cpp | 4 | ||||
-rw-r--r-- | camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp index 213bfcd..f336de2 100644 --- a/camera/OMXCameraAdapter/OMX3A.cpp +++ b/camera/OMXCameraAdapter/OMX3A.cpp @@ -273,6 +273,8 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters ¶ms, size_t MAX_METERING_AREAS; MAX_METERING_AREAS = atoi(params.get(CameraParameters::KEY_MAX_NUM_METERING_AREAS)); + Mutex::Autolock lock(mMeteringAreasLock); + mMeteringAreas.clear(); ret = CameraArea::parseAreas(str, ( strlen(str) + 1 ), mMeteringAreas); @@ -1194,6 +1196,8 @@ status_t OMXCameraAdapter::setMeteringAreas(Gen3A_settings& Gen3A) LOG_FUNCTION_NAME + Mutex::Autolock lock(mMeteringAreasLock); + if ( OMX_StateInvalid == mComponentState ) { CAMHAL_LOGEA("OMX component is in invalid state"); diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h index 0cdd4bb..e6921ed 100644 --- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h +++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h @@ -743,6 +743,7 @@ private: // Current Metering areas Vector< sp<CameraArea> > mMeteringAreas; + mutable Mutex mMeteringAreasLock; CaptureMode mCapMode; size_t mBurstFrames; |