From 8c10082a9ea9a311711887386944b71cf4d0419a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Thu, 20 Dec 2018 15:18:38 +0100 Subject: libcamera: Add Camera class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provide a Camera class which represents our main interface to handling camera devices. This is a rework of Kieran's initial proposal and Laurent's documentation of the file changed to fit the device enumerators needs. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- include/libcamera/camera.h | 31 +++++++++++++++++++++++++++++++ include/libcamera/libcamera.h | 2 ++ include/libcamera/meson.build | 1 + 3 files changed, 34 insertions(+) create mode 100644 include/libcamera/camera.h (limited to 'include') diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h new file mode 100644 index 00000000..9a7579d6 --- /dev/null +++ b/include/libcamera/camera.h @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018, Google Inc. + * + * camera.h - Camera object interface + */ +#ifndef __LIBCAMERA_CAMERA_H__ +#define __LIBCAMERA_CAMERA_H__ + +#include + +namespace libcamera { + +class Camera +{ +public: + Camera(const std::string &name); + + const std::string &name() const; + void get(); + void put(); + +private: + virtual ~Camera() { }; + int ref_; + std::string name_; +}; + +} /* namespace libcamera */ + +#endif /* __LIBCAMERA_CAMERA_H__ */ diff --git a/include/libcamera/libcamera.h b/include/libcamera/libcamera.h index 790771b6..44c094d9 100644 --- a/include/libcamera/libcamera.h +++ b/include/libcamera/libcamera.h @@ -7,6 +7,8 @@ #ifndef __LIBCAMERA_LIBCAMERA_H__ #define __LIBCAMERA_LIBCAMERA_H__ +#include + namespace libcamera { class libcamera diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build index 8c82675a..9b266ad9 100644 --- a/include/libcamera/meson.build +++ b/include/libcamera/meson.build @@ -1,4 +1,5 @@ libcamera_api = files([ + 'camera.h', 'libcamera.h', ]) -- cgit v1.2.1