summaryrefslogtreecommitdiff
path: root/camera
diff options
context:
space:
mode:
authorShuzhen Wang <shuzhenwang@google.com>2017-08-23 01:48:00 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-08-23 01:48:00 +0000
commite1af5fe87b1e6faee4f263fc9b3b614f655240f9 (patch)
treec48afa82c1f8deb2917e1a7aef370093ab3dd238 /camera
parent3a3d8dd7b9d40835992f0c4d58335e232667066e (diff)
parent2634d2f9fc2375386f24ec6677b460fb65bf6142 (diff)
QCamera2/HAL3: correct mutex lock/unlock sequence am: 78ad69467e
am: 2634d2f9fc Change-Id: Idd55d20e2503c562138cd94d066eee2e017b4e44
Diffstat (limited to 'camera')
-rw-r--r--camera/QCamera2/HAL3/QCamera3HWI.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 5b3482cb..8dfec977 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -3946,6 +3946,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;
}
}
@@ -3963,6 +3964,7 @@ int QCamera3HardwareInterface::processCaptureRequest(
if (sessionId[mLinkedCameraId] == 0xDEADBEEF) {
LOGE("Dualcam: Invalid Session Id ");
pthread_mutex_unlock(&gCamLock);
+ pthread_mutex_unlock(&mMutex);
goto error_exit;
}
@@ -3982,6 +3984,7 @@ int QCamera3HardwareInterface::processCaptureRequest(
mCameraHandle->camera_handle, m_pRelCamSyncBuf);
if (rc < 0) {
LOGE("Dualcam: link failed");
+ pthread_mutex_unlock(&mMutex);
goto error_exit;
}
}
@@ -4181,6 +4184,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;
}
}
@@ -4486,6 +4490,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;
}