Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8e73af9b authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

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
parent b343e044
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment