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>
This commit is contained in:
@@ -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__ */
|
||||
@@ -8,6 +8,7 @@
|
||||
#define __LIBCAMERA_LIBCAMERA_H__
|
||||
|
||||
#include <libcamera/camera.h>
|
||||
#include <libcamera/camera_manager.h>
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
libcamera_api = files([
|
||||
'camera.h',
|
||||
'camera_manager.h',
|
||||
'libcamera.h',
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user