diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2018-12-20 01:34:49 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2018-12-31 00:58:30 +0100 |
commit | 1c4f1563326ed1d9596a330ac750ee0decbd702f (patch) | |
tree | 33e6728a41f3cb8941517c2f4dc702071ccc56ae /include | |
parent | 7f8ef1bb99adeb5c849d5747f874412a89d1f193 (diff) |
libcamera: camera_manager: add CameraManager class
Provide a CameraManager class which will handle listing, instancing,
destruction and lifetime management of cameras.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/camera_manager.h | 38 | ||||
-rw-r--r-- | include/libcamera/libcamera.h | 1 | ||||
-rw-r--r-- | include/libcamera/meson.build | 1 |
3 files changed, 40 insertions, 0 deletions
diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h new file mode 100644 index 00000000..9d032d71 --- /dev/null +++ b/include/libcamera/camera_manager.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018, Google Inc. + * + * camera_manager.h - Camera management + */ +#ifndef __LIBCAMERA_CAMERA_MANAGER_H__ +#define __LIBCAMERA_CAMERA_MANAGER_H__ + +#include <vector> +#include <string> + +namespace libcamera { + +class Camera; +class DeviceEnumerator; +class PipelineHandler; + +class CameraManager +{ +public: + CameraManager(); + + int start(); + void stop(); + + std::vector<std::string> list() const; + Camera *get(const std::string &name); + void put(Camera *camera); + +private: + DeviceEnumerator *enumerator_; + std::vector<PipelineHandler *> pipes_; +}; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_CAMERA_MANAGER_H__ */ diff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h index 44c094d9..32fb1ff7 100644 --- a/include/libcamera/libcamera.h +++ b/include/libcamera/libcamera.h @@ -8,6 +8,7 @@ #define __LIBCAMERA_LIBCAMERA_H__ #include <libcamera/camera.h> +#include <libcamera/camera_manager.h> namespace libcamera { diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 9b266ad9..3e04557d 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -1,5 +1,6 @@ libcamera_api = files([ 'camera.h', + 'camera_manager.h', 'libcamera.h', ]) |