summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-07-10 15:13:05 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-05-14 23:56:48 +0100
commit7409e2ab0dac54bfefba2d70cc5c603fb4f52e10 (patch)
tree699d1edac437c62a5382dd34169fc1279721820b
parentd258025da7d7d555f9aa11dba700cf52409b6759 (diff)
libcamera: pipeline: Introduce skeleton Vivid Pipeline
Provide all of the skeleton stubs to succesfully compile and register a new Pipeline Handler for the Vivid test device. Meson must be reconfigured to ensure that this pipeline handler is included in the selected pipelines configuration, and after building, we can test that the PipelineHandler is successfully registered by listing the cameras on the system with LIBCAMERA_LOG_LEVELS enabled: """ LIBCAMERA_LOG_LEVELS=Pipeline:0 ./build-vivid/src/cam/cam -l [230:30:03.624102821] [2867886] DEBUG Pipeline pipeline_handler.cpp:680 Registered pipeline handler "PipelineHandlerVivid" Available cameras: """ Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--meson_options.txt3
-rw-r--r--src/libcamera/pipeline/vivid/meson.build5
-rw-r--r--src/libcamera/pipeline/vivid/vivid.cpp80
3 files changed, 87 insertions, 1 deletions
diff --git a/meson_options.txt b/meson_options.txt
index 7aa41249..43e239f6 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -53,7 +53,8 @@ option('pipelines',
'rpi/vc4',
'simple',
'uvcvideo',
- 'vimc'
+ 'vimc',
+ 'vivid',
],
description : 'Select which pipeline handlers to build. If this is set to "auto", all the pipelines applicable to the target architecture will be built. If this is set to "all", all the pipelines will be built. If both are selected then "all" will take precedence.')
diff --git a/src/libcamera/pipeline/vivid/meson.build b/src/libcamera/pipeline/vivid/meson.build
new file mode 100644
index 00000000..086bb825
--- /dev/null
+++ b/src/libcamera/pipeline/vivid/meson.build
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: CC0-1.0
+
+libcamera_sources += files([
+ 'vivid.cpp',
+])
diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp
new file mode 100644
index 00000000..6bf12783
--- /dev/null
+++ b/src/libcamera/pipeline/vivid/vivid.cpp
@@ -0,0 +1,80 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2020, Google Inc.
+ *
+ * vivid.cpp - Pipeline handler for the vivid capture device
+ */
+
+#include <libcamera/base/log.h>
+
+#include "libcamera/internal/camera.h"
+#include "libcamera/internal/pipeline_handler.h"
+
+namespace libcamera {
+
+LOG_DEFINE_CATEGORY(VIVID)
+
+class PipelineHandlerVivid : public PipelineHandler
+{
+public:
+ PipelineHandlerVivid(CameraManager *manager);
+
+ std::unique_ptr<CameraConfiguration>
+ generateConfiguration(Camera *camera, Span<const StreamRole> roles) override;
+ int configure(Camera *camera, CameraConfiguration *config) override;
+
+ int exportFrameBuffers(Camera *camera, Stream *stream,
+ std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;
+
+ int start(Camera *camera, const ControlList *controls) override;
+ void stopDevice(Camera *camera) override;
+
+ int queueRequestDevice(Camera *camera, Request *request) override;
+
+ bool match(DeviceEnumerator *enumerator) override;
+};
+
+PipelineHandlerVivid::PipelineHandlerVivid(CameraManager *manager)
+ : PipelineHandler(manager)
+{
+}
+
+std::unique_ptr<CameraConfiguration>
+PipelineHandlerVivid::generateConfiguration(Camera *camera, Span<const StreamRole> roles)
+{
+ return std::unique_ptr<CameraConfiguration>(nullptr);
+}
+
+int PipelineHandlerVivid::configure(Camera *camera, CameraConfiguration *config)
+{
+ return -1;
+}
+
+int PipelineHandlerVivid::exportFrameBuffers(Camera *camera, Stream *stream,
+ std::vector<std::unique_ptr<FrameBuffer>> *buffers)
+{
+ return -1;
+}
+
+int PipelineHandlerVivid::start(Camera *camera, const ControlList *controls)
+{
+ return -1;
+}
+
+void PipelineHandlerVivid::stopDevice(Camera *camera)
+{
+}
+
+int PipelineHandlerVivid::queueRequestDevice(Camera *camera, Request *request)
+{
+ return -1;
+}
+
+bool PipelineHandlerVivid::match(DeviceEnumerator *enumerator)
+{
+ return false;
+}
+
+REGISTER_PIPELINE_HANDLER(PipelineHandlerVivid, "vivid")
+
+} /* namespace libcamera */