diff options
author | Sundar Raman <sunds@ti.com> | 2011-11-10 08:15:13 -0800 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2011-11-10 13:49:03 -0800 |
commit | f9df3ee5cfb3c3177bcc630abf6d756e8a60254c (patch) | |
tree | e54483e9f121255bb3d4562e82b2ab2b40bd8f8d /camera/inc/OMXCameraAdapter | |
parent | 3ec18006399d61e97382601d14aaa43ee339c8b6 (diff) | |
download | hardware_ti_omap4xxx-f9df3ee5cfb3c3177bcc630abf6d756e8a60254c.zip hardware_ti_omap4xxx-f9df3ee5cfb3c3177bcc630abf6d756e8a60254c.tar.gz hardware_ti_omap4xxx-f9df3ee5cfb3c3177bcc630abf6d756e8a60254c.tar.bz2 |
CameraHAL: Clear events queue fix, clear command queue on exit
Fix 2/3 for b/5593964.
1. The events queue wasn't being cleared correctly inside
OMXCameraAdapter as some items were being removed while the
index was being formulated based on the original size
2. The command queue should be cleared before posting the EXIT
message for the OMX adapter threads so as not to process those
messages since we are exiting
Change-Id: I0a5eaceb3d1504fee05b064ebb5fe888e129ad44
Signed-off-by: Sundar Raman <sunds@ti.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
Diffstat (limited to 'camera/inc/OMXCameraAdapter')
-rw-r--r-- | camera/inc/OMXCameraAdapter/OMXCameraAdapter.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h index 7358f22..463032a 100644 --- a/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h +++ b/camera/inc/OMXCameraAdapter/OMXCameraAdapter.h @@ -654,9 +654,16 @@ private: } status_t put(TIUTILS::Message* msg){ + Mutex::Autolock lock(mLock); return mCommandMsgQ.put(msg); } + void clearCommandQ() + { + Mutex::Autolock lock(mLock); + mCommandMsgQ.clear(); + } + enum { COMMAND_EXIT = -1, CAMERA_START_IMAGE_CAPTURE = 0, @@ -668,6 +675,7 @@ private: bool Handler(); TIUTILS::MessageQueue mCommandMsgQ; OMXCameraAdapter* mCameraAdapter; + Mutex mLock; }; sp<CommandHandler> mCommandHandler; @@ -685,9 +693,16 @@ public: } status_t put(TIUTILS::Message* msg){ + Mutex::Autolock lock(mLock); return mCommandMsgQ.put(msg); } + void clearCommandQ() + { + Mutex::Autolock lock(mLock); + mCommandMsgQ.clear(); + } + enum { COMMAND_EXIT = -1, CAMERA_FILL_BUFFER_DONE, @@ -697,6 +712,7 @@ public: bool Handler(); TIUTILS::MessageQueue mCommandMsgQ; OMXCameraAdapter* mCameraAdapter; + Mutex mLock; }; sp<OMXCallbackHandler> mOMXCallbackHandler; |