summaryrefslogtreecommitdiff
path: root/include/libcamera/camera_manager.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-03 13:10:37 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-01-21 11:13:49 +0200
commitf3695e9b09ce4a88d6e0480d9e5058673af34a49 (patch)
tree804d52f7b54c2add621f317fd13529d1d27bb17b /include/libcamera/camera_manager.h
parent32bf7ef239c1310fba638f35046b0f7eb13b32bf (diff)
libcamera: camera_manager: Register cameras with the camera manager
Cameras are listed through a double indirection, first iterating over all available pipeline handlers, and then listing the cameras they each support. To simplify the API make the pipeline handlers register the cameras with the camera manager directly, which lets the camera manager easily expose the list of all available cameras. The PipelineHandler API gets simplified as the handlers don't need to expose the list of cameras they have created. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include/libcamera/camera_manager.h')
-rw-r--r--include/libcamera/camera_manager.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h
index b82a8ce9..4b941fd9 100644
--- a/include/libcamera/camera_manager.h
+++ b/include/libcamera/camera_manager.h
@@ -24,9 +24,11 @@ public:
int start();
void stop();
- std::vector<std::string> list() const;
+ const std::vector<Camera *> &cameras() const { return cameras_; }
Camera *get(const std::string &name);
+ void addCamera(Camera *camera);
+
static CameraManager *instance();
void setEventDispatcher(std::unique_ptr<EventDispatcher> dispatcher);
@@ -40,6 +42,7 @@ private:
std::unique_ptr<DeviceEnumerator> enumerator_;
std::vector<PipelineHandler *> pipes_;
+ std::vector<Camera *> cameras_;
std::unique_ptr<EventDispatcher> dispatcher_;
};