summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-08-08 10:59:24 +0200
committerJacopo Mondi <jacopo.mondi@ideasonboard.com>2023-08-08 13:47:29 +0200
commit41ebdcd2a98c8648542e5201ebe06adc278f321a (patch)
tree81c47e91b31e28dc7c99efdeb4d59757bc438f50 /src
parent796adbe28e3c28547947eebf575dd55af5d7dcf2 (diff)
libcamera: Introduce CameraDevice and USBDevice
Introduce a CameraDevice base class from which the MediaDevice and USBDevice derive from. This allows to generalize the PipelineHandler base class implementation to use a generic 'CameraDevice' type in the later patches. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/camera_device.cpp22
-rw-r--r--src/libcamera/media_device.cpp2
-rw-r--r--src/libcamera/meson.build1
3 files changed, 24 insertions, 1 deletions
diff --git a/src/libcamera/camera_device.cpp b/src/libcamera/camera_device.cpp
new file mode 100644
index 00000000..a0ceba0d
--- /dev/null
+++ b/src/libcamera/camera_device.cpp
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2023, Ideas On Board Oy
+ *
+ * camera_device.cpp - Base class for camera devices
+ */
+
+#include "libcamera/internal/camera_device.h"
+
+/**
+ * \file camera_device.h
+ * \brief Base class for camera devices
+ */
+
+namespace libcamera {
+
+/**
+ * \class CameraDevice
+ * \brief Base class for camera devices
+ */
+
+} /* namespace libcamera */
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index 2949816b..f9c2dbf2 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -63,7 +63,7 @@ LOG_DEFINE_CATEGORY(MediaDevice)
* populate() before the media graph can be queried.
*/
MediaDevice::MediaDevice(const std::string &deviceNode)
- : deviceNode_(deviceNode), valid_(false), acquired_(false)
+ : CameraDevice(), deviceNode_(deviceNode), valid_(false)
{
}
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index d5562afc..3a70946a 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -5,6 +5,7 @@ libcamera_sources = files([
'byte_stream_buffer.cpp',
'camera.cpp',
'camera_controls.cpp',
+ 'camera_device.cpp',
'camera_lens.cpp',
'camera_manager.cpp',
'camera_sensor.cpp',