diff options
-rw-r--r-- | camera/AppCallbackNotifier.cpp | 8 | ||||
-rw-r--r-- | camera/BaseCameraAdapter.cpp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/camera/AppCallbackNotifier.cpp b/camera/AppCallbackNotifier.cpp index 77b0556..aa41141 100644 --- a/camera/AppCallbackNotifier.cpp +++ b/camera/AppCallbackNotifier.cpp @@ -311,8 +311,12 @@ void AppCallbackNotifier::notifyEvent() TIUTILS::Message msg; LOG_FUNCTION_NAME; { - Mutex::Autolock lock(mLock); - mEventQ.get(&msg); + Mutex::Autolock lock(mLock); + if(!mEventQ.isEmpty()) { + mEventQ.get(&msg); + } else { + return; + } } bool ret = true; CameraHalEvent *evt = NULL; diff --git a/camera/BaseCameraAdapter.cpp b/camera/BaseCameraAdapter.cpp index 69291af..ec75232 100644 --- a/camera/BaseCameraAdapter.cpp +++ b/camera/BaseCameraAdapter.cpp @@ -258,8 +258,6 @@ void BaseCameraAdapter::returnFrame(void* frameBuf, CameraFrame::FrameType frame size_t subscriberCount = 0; int refCount = -1; - Mutex::Autolock lock(mReturnFrameLock); - if ( NULL == frameBuf ) { CAMHAL_LOGEA("Invalid frameBuf"); @@ -268,6 +266,7 @@ void BaseCameraAdapter::returnFrame(void* frameBuf, CameraFrame::FrameType frame if ( NO_ERROR == res) { + Mutex::Autolock lock(mReturnFrameLock); refCount = getFrameRefCount(frameBuf, frameType); |