summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
authorAnle Pan <anle.pan@nxp.com>2024-04-04 12:18:14 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-04-20 01:37:25 +0100
commitfb74bb7df66b96dbe28702155cddfc96a1b30f78 (patch)
treef4e3110919955797d0dc0a99b31d384e839f6128 /src/android/camera_device.cpp
parent503c3a838ae5fa7fda755f80694b444019f8ac13 (diff)
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>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index d2679a97..1b6f3f3a 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -433,8 +433,6 @@ void CameraDevice::flush()
void CameraDevice::stop()
{
MutexLocker stateLock(stateMutex_);
- if (state_ == State::Stopped)
- return;
camera_->stop();