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:
Niklas Söderlund 2018-12-20 01:34:49 +01:00
parent 7f8ef1bb99
commit 1c4f156332
5 changed files with 205 additions and 0 deletions

View file

@ -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__ */

View file

@ -8,6 +8,7 @@
#define __LIBCAMERA_LIBCAMERA_H__
#include <libcamera/camera.h>
#include <libcamera/camera_manager.h>
namespace libcamera {

View file

@ -1,5 +1,6 @@
libcamera_api = files([
'camera.h',
'camera_manager.h',
'libcamera.h',
])