summaryrefslogtreecommitdiff
path: root/src/android/camera_device.h
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-05-06 18:10:42 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-06-14 12:26:27 +0200
commit1f38e4c73f5d39b366f75b774e76490850031532 (patch)
tree84e1d455472d29b80ad5179822c79f2f26f166e5 /src/android/camera_device.h
parentf461ffb69a85b6df6a8413cb7716e2b89414d64e (diff)
android: camera_device: Replace running_ with CameraState
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 <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/camera_device.h')
-rw-r--r--src/android/camera_device.h8
1 files changed, 7 insertions, 1 deletions
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<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;