diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-05 19:05:23 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-22 17:13:46 +0300 |
commit | 8e716be52900389215344577112e88df0d8616df (patch) | |
tree | f4f3b12f47f91395ef389ff33c3073b0f9726784 /src/cam/camera_session.h | |
parent | 34d986d1ec342e84db0302d28b7d8bc98c2cd054 (diff) |
cam: Move CameraConfiguration creation to CameraSession class
Creating a configuration for a camera is an operation that logically
belongs to the CameraSession class. Move it there.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/cam/camera_session.h')
-rw-r--r-- | src/cam/camera_session.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cam/camera_session.h b/src/cam/camera_session.h index 31e8d6db..39dbbdf3 100644 --- a/src/cam/camera_session.h +++ b/src/cam/camera_session.h @@ -26,7 +26,10 @@ class CameraSession { public: CameraSession(std::shared_ptr<libcamera::Camera> camera, - libcamera::CameraConfiguration *config); + const OptionsParser::Options &options); + + bool isValid() const { return config_ != nullptr; } + libcamera::CameraConfiguration *config() { return config_.get(); } int start(const OptionsParser::Options &options); void stop(); @@ -41,7 +44,7 @@ private: void processRequest(libcamera::Request *request); std::shared_ptr<libcamera::Camera> camera_; - libcamera::CameraConfiguration *config_; + std::unique_ptr<libcamera::CameraConfiguration> config_; std::map<const libcamera::Stream *, std::string> streamName_; std::unique_ptr<BufferWriter> writer_; |