libcamera/include/libcamera/camera_manager.h
Kieran Bingham 75ddd20209 libcamera: camera_manager: Move {add,remove}Camera to internal
The CameraManager exposes addCamera and removeCamera as public API
calls, while they should never be called from an application. These
calls are only expected to be used by PipelineHandlers to update the
CameraManager that a new Camera has been created and allow the Camera
Manager to expose it to applications.

Remove the public calls and update the private implementations such that
they can be used directly by the PipelineHandler through the internal
CameraManager::Private provided by the Extensible class.

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Tested-by: Ashok Sidipotu <ashok.sidipotu@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2023-06-17 22:52:32 +01:00

49 lines
985 B
C++

/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
* Copyright (C) 2018, Google Inc.
*
* camera_manager.h - Camera management
*/
#pragma once
#include <memory>
#include <string>
#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(const std::string &id);
std::shared_ptr<Camera> get(dev_t devnum);
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 */