Camera1: JpegProcessor: Do not lock until we have to
JpegProcessor::onBufferReleased is fired for both successful and failed Jpeg captures, but only cares about the failures. In success cases, onBufferReleased is always fired some time after onFrameAvailable, and sometimes the thread scheduling pushes onBufferReleased to be so late that preview restart has started, which can cause a deadlock with onBufferReleased acquiring locks in the opposite order that preview startup will. To fix, move the JpegProcessor mutex acquire to only happen in the error cases, in which case onFrameAVailable will not have fired, and the camera state will still be STILL_CAPTURE, not STOPPED or mid-preview startup. Bug: 29524651 Change-Id: I3f103e070c3b39c38117b91824cd79c5dfc757ac
Loading
Please register or sign in to comment