new file mode 100644
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2022, Google Inc.
+ *
+ * media_device.h - Media device handler
+ */
+
+#pragma once
+
+#include "libcamera/internal/media_device_base.h"
+
+namespace libcamera {
+
+class MediaDeviceVirtual : public MediaDeviceBase
+{
+public:
+ MediaDeviceVirtual(const std::string &deviceNode);
+ ~MediaDeviceVirtual();
+};
+
+} /* namespace libcamera */
@@ -32,6 +32,7 @@ libcamera_internal_headers = files([
'mapped_framebuffer.h',
'media_device.h',
'media_device_base.h',
+ 'media_device_virtual.h',
'media_object.h',
'pipeline_handler.h',
'process.h',
new file mode 100644
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2022, Google Inc.
+ *
+ * media_device.h - Media device handler
+ */
+
+#include "libcamera/internal/media_device_virtual.h"
+
+namespace libcamera {
+
+LOG_DEFINE_CATEGORY(MediaDeviceVirtual)
+
+MediaDeviceVirtual::MediaDeviceVirtual(const std::string &deviceNode)
+ : MediaDeviceBase(deviceNode)
+{
+ driver_ = "virtual";
+}
+
+MediaDeviceVirtual::~MediaDeviceVirtual() = default;
+
+} /* namespace libcamera */
@@ -33,6 +33,7 @@ libcamera_sources = files([
'mapped_framebuffer.cpp',
'media_device.cpp',
'media_device_base.cpp',
+ 'media_device_virtual.cpp',
'media_object.cpp',
'pipeline_handler.cpp',
'pixel_format.cpp',
Add a dummy class MediaDeviceVirtual, which will be used in the virtual pipeline handler and unit tests. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> --- .../libcamera/internal/media_device_virtual.h | 21 ++++++++++++++++++ include/libcamera/internal/meson.build | 1 + src/libcamera/media_device_virtual.cpp | 22 +++++++++++++++++++ src/libcamera/meson.build | 1 + 4 files changed, 45 insertions(+) create mode 100644 include/libcamera/internal/media_device_virtual.h create mode 100644 src/libcamera/media_device_virtual.cpp