Loading...
Searching...
No Matches
camera_manager.h
Go to the documentation of this file.
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2018, Google Inc.
*
* Camera management
*/
#pragma once
#include <memory>
#include <string>
#include <string_view>
#include <sys/types.h>
#include <vector>
#include <libcamera/base/class.h>
#include <libcamera/base/object.h>
#include <libcamera/base/signal.h>
namespace libcamera {
class Camera;
class CameraManager : public Object, public Extensible
{
LIBCAMERA_DECLARE_PRIVATE()
public:
CameraManager();
~CameraManager();
int start();
void stop();
std::vector<std::shared_ptr<Camera>> cameras() const;
std::shared_ptr<Camera> get(std::string_view id);
static const std::string &version() { return version_; }
Signal<std::shared_ptr<Camera>> cameraAdded;
Signal<std::shared_ptr<Camera>> cameraRemoved;
private:
LIBCAMERA_DISABLE_COPY(CameraManager)
static const std::string version_;
static CameraManager *self_;
};
} /* namespace libcamera */
libcamera::CameraManager::get
std::shared_ptr< Camera > get(std::string_view id)
Get a camera based on ID.
Definition camera_manager.cpp:398
libcamera::CameraManager::cameras
std::vector< std::shared_ptr< Camera > > cameras() const
Retrieve all available cameras.
Definition camera_manager.cpp:378
libcamera::CameraManager::start
int start()
Start the camera manager.
Definition camera_manager.cpp:338
libcamera::CameraManager::version
static const std::string & version()
Retrieve the libcamera version string.
Definition camera_manager.h:37
libcamera::CameraManager::stop
void stop()
Stop the camera manager.
Definition camera_manager.cpp:360
libcamera::CameraManager::cameraAdded
Signal< std::shared_ptr< Camera > > cameraAdded
Notify of a new camera added to the system.
Definition camera_manager.h:39
libcamera::CameraManager::cameraRemoved
Signal< std::shared_ptr< Camera > > cameraRemoved
Notify of a new camera removed from the system.
Definition camera_manager.h:40
libcamera::CameraManager::~CameraManager
~CameraManager()
Destroy the camera manager.
Definition camera_manager.cpp:321
libcamera::Camera
Camera device.
Definition camera.h:115
libcamera::Signal
Generic signal and slot communication mechanism.
Definition signal.h:39
libcamera
Top-level libcamera namespace.
Definition bound_method.h:15
signal.h
Signal & slot implementation.