mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 23:39:44 +03:00
android: camera_device: Always clear descriptors_ in stop()
When flush() is called and then a new stream configuration is set, the descriptors_ queue might have a chance to be not cleared in stop(), as the Camera is already in Stopped state. This will prevent further requests from being completed in sendCaptureResults() as the descriptors_ queue is not empty. To fix the issue, clear the descriptors_ even if the Camera State is Stopped. As a drawback the libcamera::Camera::stop() function might be called twice, but this is allowed by the Camera state machine, and the second call is guaranteed to be a nop. Signed-off-by: Anle Pan <anle.pan@nxp.com> Signed-off-by: Fang Hui <hui.fang@nxp.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
503c3a838a
commit
fb74bb7df6
1 changed files with 0 additions and 2 deletions
|
@ -433,8 +433,6 @@ void CameraDevice::flush()
|
||||||
void CameraDevice::stop()
|
void CameraDevice::stop()
|
||||||
{
|
{
|
||||||
MutexLocker stateLock(stateMutex_);
|
MutexLocker stateLock(stateMutex_);
|
||||||
if (state_ == State::Stopped)
|
|
||||||
return;
|
|
||||||
|
|
||||||
camera_->stop();
|
camera_->stop();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue