diff options
Diffstat (limited to 'services/camera/libcameraservice/CameraClient.cpp')
-rw-r--r-- | services/camera/libcameraservice/CameraClient.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp index 967562d..1254962 100644 --- a/services/camera/libcameraservice/CameraClient.cpp +++ b/services/camera/libcameraservice/CameraClient.cpp @@ -697,6 +697,12 @@ void CameraClient::disableMsgType(int32_t msgType) { bool CameraClient::lockIfMessageWanted(int32_t msgType) { int sleepCount = 0; while (mMsgEnabled & msgType) { + if ((msgType == CAMERA_MSG_PREVIEW_FRAME) && + (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE)) { + LOG1("lockIfMessageWanted(%d): Don't try to acquire mlock if " + "both Preview and Compressed are enabled", msgType); + return false; + } if (mLock.tryLock() == NO_ERROR) { if (sleepCount > 0) { LOG1("lockIfMessageWanted(%d): waited for %d ms", |