From 1f38e4c73f5d39b366f75b774e76490850031532 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Thu, 6 May 2021 18:10:42 +0200 Subject: android: camera_device: Replace running_ with CameraState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CameraDevice class maintains the camera state in the 'running_' boolean flag to check if the camera has to be started at the first received process_capture_request() call which happens after the camera had been stopped. So far this was correct, as the operations that change the camera could only start or stop the camera, so a simple boolean flag was enough. To prepare to handle the flush() operation that will introduce a new 'flushing' state, replace the simple plain boolean flag with an enumeration of values that define the CameraState. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- src/android/camera_device.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/android/camera_device.h') diff --git a/src/android/camera_device.h b/src/android/camera_device.h index decf1754..70c29755 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -89,6 +89,11 @@ private: int androidFormat; }; + enum class State { + Stopped, + Running, + }; + void stop(); int initializeStreamConfigurations(); @@ -115,7 +120,8 @@ private: CameraWorker worker_; - bool running_; + State state_; + std::shared_ptr camera_; std::unique_ptr config_; -- cgit v1.2.1