diff options
author | Emilian Peev <epeev@mm-sol.com> | 2012-02-10 15:00:34 +0200 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-07-25 08:55:43 -0500 |
commit | 994fa9105056ee72d4897fdc248edb7be9745d19 (patch) | |
tree | 5740baadf12ee75ecb4bb59330547f0d3d78362c | |
parent | ff4e31d0dec32d7219024df9cb0de99999487747 (diff) | |
download | hardware_ti_omap4-994fa9105056ee72d4897fdc248edb7be9745d19.zip hardware_ti_omap4-994fa9105056ee72d4897fdc248edb7be9745d19.tar.gz hardware_ti_omap4-994fa9105056ee72d4897fdc248edb7be9745d19.tar.bz2 |
CameraHAL: Lock mutex on handleFrameReturn
- Prevents an issue when concurrent access to the buffer map
may crash the CameraHAL.
Change-Id: I74b8abde0e2a56fa73da6655c3b3529b55974a32
Signed-off-by: Emilian Peev <epeev@mm-sol.com>
-rw-r--r-- | camera/ANativeWindowDisplayAdapter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/camera/ANativeWindowDisplayAdapter.cpp b/camera/ANativeWindowDisplayAdapter.cpp index 49204d8..747168e 100644 --- a/camera/ANativeWindowDisplayAdapter.cpp +++ b/camera/ANativeWindowDisplayAdapter.cpp @@ -1220,7 +1220,10 @@ bool ANativeWindowDisplayAdapter::handleFrameReturn() usleep(15000); } - mFramesWithCameraAdapterMap.add((int) mGrallocHandleMap[i], i); + { + Mutex::Autolock lock(mLock); + mFramesWithCameraAdapterMap.add((int) mGrallocHandleMap[i], i); + } CAMHAL_LOGVB("handleFrameReturn: found graphic buffer %d of %d", i, mBufferCount-1); mFrameProvider->returnFrame( (void*)mGrallocHandleMap[i], CameraFrame::PREVIEW_FRAME_SYNC); |