summaryrefslogtreecommitdiff
path: root/src/cam/camera_session.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-06 07:49:15 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-07-22 17:13:59 +0300
commit7dab1fa58fb77ace2742dadf860d91f29474225f (patch)
tree990ff9173ccccea430f4f8f11667675ee481225c /src/cam/camera_session.h
parent5082fe7b5b9ea7e073e409fd8b73126951803456 (diff)
cam: Make camera-related options sub-options of OptCamera
Use the new hierarchical options feature of the option parser to turn camera-related option (--capture, --file, --stream, --strict-formats and --metadata) into children of the --camera option. As an added bonus, we don't need to check anymore if a camera has been specified when capture is requested, as that's now enforced by the option parser. This change prepares for support of multiple cameras. 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.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cam/camera_session.h b/src/cam/camera_session.h
index 6221aada..b3136383 100644
--- a/src/cam/camera_session.h
+++ b/src/cam/camera_session.h
@@ -9,6 +9,7 @@
#include <memory>
#include <stdint.h>
+#include <string>
#include <vector>
#include <libcamera/base/signal.h>
@@ -27,10 +28,12 @@ class CameraSession
{
public:
CameraSession(libcamera::CameraManager *cm,
+ const std::string &cameraId,
const OptionsParser::Options &options);
~CameraSession();
bool isValid() const { return config_ != nullptr; }
+ const OptionsParser::Options &options() { return options_; }
libcamera::Camera *camera() { return camera_.get(); }
libcamera::CameraConfiguration *config() { return config_.get(); }
@@ -39,7 +42,7 @@ public:
void listProperties() const;
void infoConfiguration() const;
- int start(const OptionsParser::Options &options);
+ int start();
void stop();
libcamera::Signal<> captureDone;
@@ -51,6 +54,7 @@ private:
void requestComplete(libcamera::Request *request);
void processRequest(libcamera::Request *request);
+ const OptionsParser::Options &options_;
std::shared_ptr<libcamera::Camera> camera_;
std::unique_ptr<libcamera::CameraConfiguration> config_;