QCamera2: HAL3: Avoid race condition during HFR video stop
The video stream stop sequence can encounter a race conidtion
in case pending buffers arrive during the same time frame. Any
incoming stream callbacks that manage to execute during the
window between 'mDataQ' flush and 'flushFreeBatchBufQ' will modify
the 'mBufsStaged' counter without the knowledge of the top
'QCamera3HardwareInterface' instance. This makes subsequent calls
'aggregateBufToBatch' prone to batch overflow errors.
To resolve this, call 'flushFreeBatchBufQ' before flushing 'mDataQ'.
This way calls to 'aggregateBufToBatch' from failing stream
callbacks should not be successfull in modifiying 'mBufsStaged'.
Test: Camera CTS
1 file changed