mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 16:45:07 +03:00
libcamera: camera_manager: Make the class a singleton
There can only be a single camera manager instance in the application. Creating it as a singleton helps avoiding mistakes. It also allows the camera manager to be used as a storage of global data, such as the future event dispatcher. 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>
This commit is contained in:
parent
f3829b5745
commit
8b0de29c41
3 changed files with 22 additions and 8 deletions
|
@ -19,15 +19,19 @@ class PipelineHandler;
|
|||
class CameraManager
|
||||
{
|
||||
public:
|
||||
CameraManager();
|
||||
|
||||
int start();
|
||||
void stop();
|
||||
|
||||
std::vector<std::string> list() const;
|
||||
Camera *get(const std::string &name);
|
||||
|
||||
static CameraManager *instance();
|
||||
|
||||
private:
|
||||
CameraManager();
|
||||
CameraManager(const CameraManager &) = delete;
|
||||
void operator=(const CameraManager &) = delete;
|
||||
|
||||
DeviceEnumerator *enumerator_;
|
||||
std::vector<PipelineHandler *> pipes_;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue