diff options
| author | Shuzhen Wang <shuzhenwang@google.com> | 2017-08-23 01:45:01 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2017-08-23 01:45:01 +0000 |
| commit | 2634d2f9fc2375386f24ec6677b460fb65bf6142 (patch) | |
| tree | 77cda630870208b3a2a54491ddf36f24b895fc96 /camera | |
| parent | 3fdac907f51d72b97154129c9ba01d498fe547b3 (diff) | |
| parent | 78ad69467eefa405f54d36472cdcf535c0b500b1 (diff) | |
QCamera2/HAL3: correct mutex lock/unlock sequence
am: 78ad69467e
Change-Id: I826c3de488bdde0949f80836266746f670dbe8cc
Diffstat (limited to 'camera')
| -rw-r--r-- | camera/QCamera2/HAL3/QCamera3HWI.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp index 3d17918e..8ab7102f 100644 --- a/camera/QCamera2/HAL3/QCamera3HWI.cpp +++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp @@ -3948,6 +3948,7 @@ int QCamera3HardwareInterface::processCaptureRequest( (mLinkedCameraId != mCameraId) ) { LOGE("Dualcam: mLinkedCameraId %d is invalid, current cam id = %d", mLinkedCameraId, mCameraId); + pthread_mutex_unlock(&mMutex); goto error_exit; } } @@ -3965,6 +3966,7 @@ int QCamera3HardwareInterface::processCaptureRequest( if (sessionId[mLinkedCameraId] == 0xDEADBEEF) { LOGE("Dualcam: Invalid Session Id "); pthread_mutex_unlock(&gCamLock); + pthread_mutex_unlock(&mMutex); goto error_exit; } @@ -3984,6 +3986,7 @@ int QCamera3HardwareInterface::processCaptureRequest( mCameraHandle->camera_handle, m_pRelCamSyncBuf); if (rc < 0) { LOGE("Dualcam: link failed"); + pthread_mutex_unlock(&mMutex); goto error_exit; } } @@ -4183,6 +4186,7 @@ no_error: if(ADD_SET_PARAM_ENTRY_TO_BATCH(mParameters, CAM_INTF_META_FRAME_NUMBER, request->frame_number)) { LOGE("Failed to set the frame number in the parameters"); + pthread_mutex_unlock(&mMutex); return BAD_VALUE; } } @@ -4488,6 +4492,7 @@ no_error: /* Update stream id of all the requested buffers */ if (ADD_SET_PARAM_ENTRY_TO_BATCH(mParameters, CAM_INTF_META_STREAM_ID, streamsArray)) { LOGE("Failed to set stream type mask in the parameters"); + pthread_mutex_unlock(&mMutex); return BAD_VALUE; } |
