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>
This commit is contained in:
@@ -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_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user