libcamera v0.1.0+127-8e215127-dirty (2023-12-02T01:06:12+00:00)
Supporting cameras in Linux since 2019
camera_manager.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2018, Google Inc.
4 *
5 * camera_manager.h - Camera management
6 */
7
8#pragma once
9
10#include <memory>
11#include <string>
12#include <sys/types.h>
13#include <vector>
14
18
19namespace libcamera {
20
21class Camera;
22
23class CameraManager : public Object, public Extensible
24{
26public:
29
30 int start();
31 void stop();
32
33 std::vector<std::shared_ptr<Camera>> cameras() const;
34 std::shared_ptr<Camera> get(const std::string &id);
35
36 static const std::string &version() { return version_; }
37
40
41private:
43
44 static const std::string version_;
45 static CameraManager *self_;
46};
47
48} /* namespace libcamera */
Utilities to help constructing class interfaces.
#define LIBCAMERA_DECLARE_PRIVATE()
Declare private data for a public class.
#define LIBCAMERA_DISABLE_COPY(klass)
Disable copy construction and assignment of the klass.
Provide access and manage all cameras in the system.
Definition: camera_manager.h:24
std::vector< std::shared_ptr< Camera > > cameras() const
Retrieve all available cameras.
Definition: camera_manager.cpp:322
static const std::string & version()
Retrieve the libcamera version string.
Definition: camera_manager.h:36
int start()
Start the camera manager.
Definition: camera_manager.cpp:282
Signal< std::shared_ptr< Camera > > cameraAdded
Notify of a new camera added to the system.
Definition: camera_manager.h:38
Signal< std::shared_ptr< Camera > > cameraRemoved
Notify of a new camera removed from the system.
Definition: camera_manager.h:39
void stop()
Stop the camera manager.
Definition: camera_manager.cpp:304
std::shared_ptr< Camera > get(const std::string &id)
Get a camera based on ID.
Definition: camera_manager.cpp:342
~CameraManager()
Destroy the camera manager.
Definition: camera_manager.cpp:265
Base class to manage private data through a d-pointer.
Definition: class.h:62
Base object to support automatic signal disconnection.
Definition: object.h:25
Generic signal and slot communication mechanism.
Definition: signal.h:39
Top-level libcamera namespace.
Definition: backtrace.h:17
Base object to support automatic signal disconnection.
Signal & slot implementation.