{"id":25468,"url":"https://patchwork.libcamera.org/api/1.1/patches/25468/?format=json","web_url":"https://patchwork.libcamera.org/patch/25468/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20251210164055.17856-4-david.plowman@raspberrypi.com>","date":"2025-12-10T16:15:18","name":"[03/11] libcamera: sensor: Add CameraSensorMemory class","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"4e224dbbe1ba7f38b7a4895c5246a6a3a0e41829","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/1.1/people/42/?format=json","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/25468/mbox/","series":[{"id":5650,"url":"https://patchwork.libcamera.org/api/1.1/series/5650/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5650","date":"2025-12-10T16:15:15","name":"Bayer re-processing","version":1,"mbox":"https://patchwork.libcamera.org/series/5650/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/25468/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/25468/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 77DF2C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 16:41:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05288614A5;\n\tWed, 10 Dec 2025 17:41:08 +0100 (CET)","from mail-wm1-x332.google.com (mail-wm1-x332.google.com\n\t[IPv6:2a00:1450:4864:20::332])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65062614B1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 17:41:02 +0100 (CET)","by mail-wm1-x332.google.com with SMTP id\n\t5b1f17b1804b1-47795f6f5c0so46405385e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 08:41:02 -0800 (PST)","from davidp-pi5.pitowers.org\n\t([2a00:1098:3142:1f:88ea:c658:5b20:5e46])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-47a88371e13sm1270415e9.11.2025.12.10.08.41.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Dec 2025 08:41:00 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"lZDyan4T\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1765384862; x=1765989662;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=8qIf10Gl0HoH/74okVhYV2SwichdzIgd8dv13WEYdyk=;\n\tb=lZDyan4TJAaNVdYcuruMwbUErwkwwd5imu1voPpGpJ5Q+bSjHVhpStIid4GaVjcgMJ\n\tVoP38tg9CZUr/AsG+9S2VgREm4XBhcsrNq9MMjLD60C+wN0pGqK9W5NX69uNRUgyIPJQ\n\t1SE+OteBQR8iXSb8r7K8IWqBuQBr8CkokXka43W1JQ9TslHdm+MloEvCJrNhmdmaiEzY\n\tiPvHiMraIt31L7LA/03TTYjuiVW7GmoPh9Uyal2z0Il6ydKXUBoLCZChXhglMEHHcna3\n\tu/whhl8kNu/rmxVWZXgrQ+BuZ61CAwyI67z9R0BzlMWRMCK/mA5VoDSv2rNtwyKJvXqv\n\tADzw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1765384862; x=1765989662;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=8qIf10Gl0HoH/74okVhYV2SwichdzIgd8dv13WEYdyk=;\n\tb=eWDto0oluwmv+WmGI7v9glYif/RmCSyQNuMLhwMdhnDyAppL3wbvtOwOUPBKQWJQfC\n\tu39Oo+INpIwZVhopLT7IfsMSWuCHDWniIuGtYFs1BwtfaN+hgFq1np7HUrLLKCGFn8zy\n\tWHjljACH5R3Y6gOp0FSzrzNGgGN81sZ7LCHkI0k4D0MeUnl2R3AcO2JizVey0VflEpVG\n\tQSOZPXOU9vWanP9cjHGF3MdL46ixkm6F9uK3iUx3DBJu14ivom4ZvDeGrAi0JeZo2wDf\n\tpFtVZARhf4cSZnFR7Mr0QvwaAfTmuOpQm0lejY/8pmSXWv3xy7KL4xCv0cPY9GDQ1TQL\n\tpPJQ==","X-Gm-Message-State":"AOJu0YxAuQ+kL7U3Of+r4drbgkb9PwQedbfhkqajCbs0ZvUbLtvr9dxT\n\txFnPVyWWw2TmgOvJ9U2P0Xf8DtVFCC+wiyrCahk7EYLHz7TGL8lCRnvWq7daKtu1KDjBXQf0fAf\n\tOnYpz","X-Gm-Gg":"ASbGncvdHHi9Mza+ekI/c5uIA+E6XGuIyxFez/U1aCOz+ZZCsP1wmiaBEy41denbO3Z\n\tUHg7uGeZceDNyqzvThF6PU+Qp382Ce424ZZr8m7FI4ZcQYlQgqw2LyGhJ4f9arixsE2yWtvUmj3\n\tRcs7YP8jqpo2XWTAhgLhDu3lqG/YdvyH91rsYuyEo+E849Y1FxbvKZkn76HAXyFe/+06w9aIjkQ\n\tdR/P/15FD6UE/8ven3tpW7lEf2iDRhpzT8WzQXmWpC/5ZA56Fnh4Of4thQ0oJpWWbjpAQdfR2Lu\n\twcC6XbRIcCwh9LuF/LAQdtuUHcZRYJ9rNINmLtCx+Av7JseMAbx6VM5rAEdSRugjLvg4xZEQMu+\n\tEkq28/md+VbWe4Wrsni9aGQXUcm7q2gB94Sf227AKQ6+IjJd84OZO/5iM88Sb3RFfg/LeHtH6R4\n\tcy7vmjGZkI+b8XzmDRPXsB0saSiyVCXQj+ln00/uBANibVxyNRAAXu+jXUnEQBrwbQawCU7nib8\n\tPsp11jT5VZ6gMjkCFSawe4zG3iGEm5vPo2WSQoa","X-Google-Smtp-Source":"AGHT+IEgIn/mqhl99WKqU5WnIkNOcPnWJnVMAl7iGF2NU8xIgvlSLpiliP51wDTxEEFROhuUNXF7ZQ==","X-Received":"by 2002:a05:600c:3513:b0:479:3a89:121e with SMTP id\n\t5b1f17b1804b1-47a8381e5a5mr24587125e9.37.1765384861397; \n\tWed, 10 Dec 2025 08:41:01 -0800 (PST)","From":"David Plowman <david.plowman@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"David Plowman <david.plowman@raspberrypi.com>","Subject":"[PATCH 03/11] libcamera: sensor: Add CameraSensorMemory class","Date":"Wed, 10 Dec 2025 16:15:18 +0000","Message-ID":"<20251210164055.17856-4-david.plowman@raspberrypi.com>","X-Mailer":"git-send-email 2.47.3","In-Reply-To":"<20251210164055.17856-1-david.plowman@raspberrypi.com>","References":"<20251210164055.17856-1-david.plowman@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Representation of a \"camera\" that actually takes its input from\na memory buffer.\n\nlibcamera is, unsurprisingly, very dependent on having a camera\nconnected to the system. But sometimes we may want to process raw\ncamera images from elsewhere, and we may not have a camera connected\nto the system at all.\n\nIn such cases, the path of a \"memory buffer\" through the code is eased\nconsiderably by introducing the CameraSensorMemory class, which allows\nthe memory buffer to behave, to an extent at least, like a real\ncamera.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n include/libcamera/internal/camera_sensor.h    |   2 +\n .../libcamera/internal/camera_sensor_memory.h | 110 ++++++++\n include/libcamera/internal/meson.build        |   1 +\n src/libcamera/sensor/camera_sensor_memory.cpp | 241 ++++++++++++++++++\n src/libcamera/sensor/meson.build              |   1 +\n 5 files changed, 355 insertions(+)\n create mode 100644 include/libcamera/internal/camera_sensor_memory.h\n create mode 100644 src/libcamera/sensor/camera_sensor_memory.cpp","diff":"diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex e6b72d22..5580d6ec 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -49,6 +49,8 @@ public:\n \n \tvirtual CameraLens *focusLens() = 0;\n \n+\tvirtual bool isMemory() const { return false; }\n+\n \tvirtual const std::vector<unsigned int> &mbusCodes() const = 0;\n \tvirtual std::vector<Size> sizes(unsigned int mbusCode) const = 0;\n \tvirtual Size resolution() const = 0;\ndiff --git a/include/libcamera/internal/camera_sensor_memory.h b/include/libcamera/internal/camera_sensor_memory.h\nnew file mode 100644\nindex 00000000..944d4c96\n--- /dev/null\n+++ b/include/libcamera/internal/camera_sensor_memory.h\n@@ -0,0 +1,110 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2025, Raspberry Pi plc\n+ *\n+ * camera_sensor_memory.h - A fake camera sensor for reading raw data from memory\n+ */\n+\n+#pragma once\n+\n+#include <optional>\n+#include <string>\n+#include <vector>\n+\n+#include <libcamera/camera.h>\n+\n+#include \"libcamera/internal/camera_sensor.h\"\n+\n+namespace libcamera {\n+\n+class BayerFormat;\n+class Camera;\n+class CameraLens;\n+class MediaEntity;\n+class SensorConfiguration;\n+\n+struct CameraSensorProperties;\n+\n+enum class Orientation;\n+\n+LOG_DECLARE_CATEGORY(CameraSensor)\n+\n+class CameraSensorMemory : public CameraSensor, protected Loggable\n+{\n+public:\n+\tCameraSensorMemory(const StreamConfiguration &rawInput, unsigned int mbusCode);\n+\t~CameraSensorMemory();\n+\n+\tstatic std::variant<std::unique_ptr<CameraSensor>, int>\n+\tmatch(MediaEntity *entity);\n+\n+\tconst std::string &model() const override { return model_; }\n+\tconst std::string &id() const override { return id_; }\n+\n+\tconst MediaEntity *entity() const override { return nullptr; }\n+\tV4L2Subdevice *device() override { return nullptr; }\n+\n+\tCameraLens *focusLens() override { return nullptr; }\n+\n+\tvirtual bool isMemory() const override { return true; }\n+\n+\tconst std::vector<unsigned int> &mbusCodes() const override;\n+\tstd::vector<Size> sizes(unsigned int mbusCode) const override;\n+\tSize resolution() const override;\n+\n+\tV4L2SubdeviceFormat getFormat(Span<const unsigned int> mbusCodes,\n+\t\t\t\t      const Size &size,\n+\t\t\t\t      const Size maxSize) const override;\n+\tint setFormat(V4L2SubdeviceFormat *format,\n+\t\t      Transform transform = Transform::Identity) override;\n+\tint tryFormat(V4L2SubdeviceFormat *format) const override;\n+\n+\tint applyConfiguration(const SensorConfiguration &config,\n+\t\t\t       Transform transform = Transform::Identity,\n+\t\t\t       V4L2SubdeviceFormat *sensorFormat = nullptr) override;\n+\n+\tV4L2Subdevice::Stream imageStream() const override;\n+\tstd::optional<V4L2Subdevice::Stream> embeddedDataStream() const override;\n+\tV4L2SubdeviceFormat embeddedDataFormat() const override;\n+\tint setEmbeddedDataEnabled(bool enable) override;\n+\n+\tconst ControlList &properties() const override;\n+\tint sensorInfo(IPACameraSensorInfo *info) const override;\n+\tTransform computeTransform(Orientation *orientation) const override;\n+\tBayerFormat::Order bayerOrder(Transform t) const override;\n+\tOrientation mountingOrientation() const override;\n+\n+\tconst ControlInfoMap &controls() const override;\n+\tControlList getControls(Span<const uint32_t> ids) override;\n+\tint setControls(ControlList *ctrls) override;\n+\n+\tconst std::vector<controls::draft::TestPatternModeEnum> &\n+\ttestPatternModes() const override { return testPatternModes_; }\n+\tint setTestPatternMode(controls::draft::TestPatternModeEnum mode) override;\n+\tconst CameraSensorProperties::SensorDelays &sensorDelays() override;\n+\n+protected:\n+\tstd::string logPrefix() const override;\n+\n+private:\n+\tLIBCAMERA_DISABLE_COPY(CameraSensorMemory)\n+\n+\tStreamConfiguration rawInput_;\n+\n+\tstd::string model_;\n+\tstd::string id_;\n+\n+\tBayerFormat bayerFormat_;\n+\tstd::vector<unsigned int> mbusCodes_;\n+\n+\tV4L2SubdeviceFormat v4l2SubdeviceFormat_;\n+\n+\tControlInfoMap propertiesInfoMap_;\n+\tControlInfoMap controlsInfoMap_;\n+\tControlList properties_;\n+\tControlList controls_;\n+\n+\tstd::vector<controls::draft::TestPatternModeEnum> testPatternModes_;\n+};\n+\n+} /* namespace libcamera */\ndiff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\nindex e9540a2f..9994baae 100644\n--- a/include/libcamera/internal/meson.build\n+++ b/include/libcamera/internal/meson.build\n@@ -10,6 +10,7 @@ libcamera_internal_headers = files([\n     'camera_lens.h',\n     'camera_manager.h',\n     'camera_sensor.h',\n+    'camera_sensor_memory.h',\n     'camera_sensor_properties.h',\n     'clock_recovery.h',\n     'control_serializer.h',\ndiff --git a/src/libcamera/sensor/camera_sensor_memory.cpp b/src/libcamera/sensor/camera_sensor_memory.cpp\nnew file mode 100644\nindex 00000000..8e344016\n--- /dev/null\n+++ b/src/libcamera/sensor/camera_sensor_memory.cpp\n@@ -0,0 +1,241 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2025, Raspberry Pi plc\n+ *\n+ * camera_sensor_memory.cpp - A fake camera sensor for reading raw data from memory\n+ */\n+\n+#include \"libcamera/internal/camera_sensor_memory.h\"\n+\n+#include <algorithm>\n+#include <map>\n+#include <sstream>\n+\n+#include <libcamera/base/log.h>\n+#include <libcamera/base/utils.h>\n+\n+#include <libcamera/control_ids.h>\n+#include <libcamera/controls.h>\n+#include <libcamera/geometry.h>\n+#include <libcamera/orientation.h>\n+#include <libcamera/property_ids.h>\n+#include <libcamera/transform.h>\n+\n+#include <libcamera/ipa/core_ipa_interface.h>\n+\n+#include \"libcamera/internal/bayer_format.h\"\n+#include \"libcamera/internal/formats.h\"\n+#include \"libcamera/internal/v4l2_subdevice.h\"\n+\n+namespace libcamera {\n+\n+LOG_DECLARE_CATEGORY(CameraSensor)\n+\n+static bool v4l2SubdeviceFormatEqual(const V4L2SubdeviceFormat &lhs, const V4L2SubdeviceFormat &rhs)\n+{\n+\treturn lhs.code == rhs.code && lhs.size == rhs.size && lhs.colorSpace == rhs.colorSpace;\n+}\n+\n+CameraSensorMemory::CameraSensorMemory(const StreamConfiguration &rawInput, unsigned int mbusCode)\n+\t: rawInput_(rawInput), properties_(propertiesInfoMap_), controls_(controlsInfoMap_)\n+{\n+\tmodel_ = \"memory\";\n+\n+\tstd::ostringstream oss;\n+\toss << &rawInput;\n+\tid_ = oss.str();\n+\n+\t/* The \"camera\" must appear to return the format the raw input wants. */\n+\tbayerFormat_ = BayerFormat::fromPixelFormat(rawInput.pixelFormat);\n+\tmbusCodes_ = { mbusCode };\n+\n+\tv4l2SubdeviceFormat_ = V4L2SubdeviceFormat{\n+\t\t.code = mbusCode,\n+\t\t.size = rawInput.size,\n+\t\t.colorSpace = ColorSpace::Raw,\n+\t};\n+}\n+\n+CameraSensorMemory::~CameraSensorMemory() = default;\n+\n+std::variant<std::unique_ptr<CameraSensor>, int>\n+CameraSensorMemory::match([[maybe_unused]] MediaEntity *entity)\n+{\n+\treturn {};\n+}\n+\n+const std::vector<unsigned int> &CameraSensorMemory::mbusCodes() const\n+{\n+\treturn mbusCodes_;\n+}\n+\n+std::vector<Size> CameraSensorMemory::sizes(unsigned int mbusCode) const\n+{\n+\tif (mbusCode == mbusCodes_[0])\n+\t\treturn { rawInput_.size };\n+\telse\n+\t\treturn {};\n+}\n+\n+Size CameraSensorMemory::resolution() const\n+{\n+\treturn rawInput_.size;\n+}\n+\n+V4L2SubdeviceFormat CameraSensorMemory::getFormat(Span<const unsigned int> mbusCodes,\n+\t\t\t\t\t\t  [[maybe_unused]] const Size &size,\n+\t\t\t\t\t\t  const Size maxSize) const\n+{\n+\tif (std::find(mbusCodes.begin(), mbusCodes.end(), mbusCodes_[0]) == mbusCodes.end())\n+\t\treturn {};\n+\n+\tif (maxSize.width < rawInput_.size.width || maxSize.height < rawInput_.size.height)\n+\t\treturn {};\n+\n+\treturn v4l2SubdeviceFormat_;\n+}\n+\n+int CameraSensorMemory::setFormat(V4L2SubdeviceFormat *format,\n+\t\t\t\t  Transform transform)\n+{\n+\tif (v4l2SubdeviceFormatEqual(*format, v4l2SubdeviceFormat_) &&\n+\t    transform == Transform::Identity)\n+\t\treturn 0;\n+\n+\treturn -EPERM;\n+}\n+\n+int CameraSensorMemory::tryFormat(V4L2SubdeviceFormat *format) const\n+{\n+\tif (v4l2SubdeviceFormatEqual(*format, v4l2SubdeviceFormat_))\n+\t\treturn 0;\n+\n+\treturn -EPERM;\n+}\n+\n+int CameraSensorMemory::applyConfiguration(const SensorConfiguration &config,\n+\t\t\t\t\t   Transform transform,\n+\t\t\t\t\t   V4L2SubdeviceFormat *sensorFormat)\n+{\n+\tif (config.bitDepth != bayerFormat_.bitDepth ||\n+\t    config.outputSize != rawInput_.size ||\n+\t    config.binning.binX != 1 || config.binning.binY != 1 ||\n+\t    config.skipping.xOddInc != 1 || config.skipping.xEvenInc != 1 ||\n+\t    config.skipping.yOddInc != 1 || config.skipping.yEvenInc != 1 ||\n+\t    transform != Transform::Identity)\n+\t\treturn -EPERM;\n+\n+\tif (sensorFormat)\n+\t\t*sensorFormat = v4l2SubdeviceFormat_;\n+\n+\treturn 0;\n+}\n+\n+V4L2Subdevice::Stream CameraSensorMemory::imageStream() const\n+{\n+\treturn V4L2Subdevice::Stream();\n+}\n+\n+std::optional<V4L2Subdevice::Stream> CameraSensorMemory::embeddedDataStream() const\n+{\n+\treturn {};\n+}\n+\n+V4L2SubdeviceFormat CameraSensorMemory::embeddedDataFormat() const\n+{\n+\treturn {};\n+}\n+\n+int CameraSensorMemory::setEmbeddedDataEnabled(bool enable)\n+{\n+\treturn enable ? -ENOSTR : 0;\n+}\n+\n+const ControlList &CameraSensorMemory::properties() const\n+{\n+\treturn properties_;\n+}\n+\n+int CameraSensorMemory::sensorInfo([[maybe_unused]] IPACameraSensorInfo *info) const\n+{\n+\tinfo->model = model();\n+\n+\tinfo->bitsPerPixel = bayerFormat_.bitDepth;\n+\tinfo->cfaPattern = properties::draft::RGB;\n+\n+\tinfo->activeAreaSize = rawInput_.size;\n+\tinfo->analogCrop = Rectangle(rawInput_.size);\n+\tinfo->outputSize = rawInput_.size;\n+\n+\t/*\n+\t * These are meaningless for us, fill with ones rather than zeros because the\n+\t * code will divide by some of these numbers.\n+\t */\n+\tinfo->pixelRate = 1;\n+\tinfo->minLineLength = 1;\n+\tinfo->maxLineLength = 1;\n+\tinfo->minFrameLength = 1;\n+\tinfo->maxFrameLength = 1;\n+\n+\treturn 0;\n+}\n+\n+Transform CameraSensorMemory::computeTransform(Orientation *orientation) const\n+{\n+\t*orientation = Orientation::Rotate0;\n+\treturn Transform::Identity;\n+}\n+\n+BayerFormat::Order CameraSensorMemory::bayerOrder([[maybe_unused]] Transform t) const\n+{\n+\treturn bayerFormat_.order;\n+}\n+\n+Orientation CameraSensorMemory::mountingOrientation() const\n+{\n+\treturn Orientation::Rotate0;\n+}\n+\n+const ControlInfoMap &CameraSensorMemory::controls() const\n+{\n+\treturn *controls_.infoMap();\n+}\n+\n+ControlList CameraSensorMemory::getControls([[maybe_unused]] Span<const uint32_t> ids)\n+{\n+\treturn ControlList();\n+}\n+\n+int CameraSensorMemory::setControls([[maybe_unused]] ControlList *ctrls)\n+{\n+\treturn -EPERM;\n+}\n+\n+int CameraSensorMemory::setTestPatternMode([[maybe_unused]] controls::draft::TestPatternModeEnum mode)\n+{\n+\treturn -EPERM;\n+}\n+\n+const CameraSensorProperties::SensorDelays &CameraSensorMemory::sensorDelays()\n+{\n+\tstatic constexpr CameraSensorProperties::SensorDelays defaultSensorDelays = {\n+\t\t.exposureDelay = 2,\n+\t\t.gainDelay = 1,\n+\t\t.vblankDelay = 2,\n+\t\t.hblankDelay = 2,\n+\t};\n+\n+\treturn defaultSensorDelays; /* but doesn't mean anything */\n+}\n+\n+std::string CameraSensorMemory::logPrefix() const\n+{\n+\treturn \"'memory'\";\n+}\n+\n+/*\n+ * We're not going to register this camera sensor as it doesn't match media entities\n+ * like other sensors. Pipeline handlers will have to call it explicitly.\n+ */\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/sensor/meson.build b/src/libcamera/sensor/meson.build\nindex dce74ed6..b9b87612 100644\n--- a/src/libcamera/sensor/meson.build\n+++ b/src/libcamera/sensor/meson.build\n@@ -3,6 +3,7 @@\n libcamera_internal_sources += files([\n     'camera_sensor.cpp',\n     'camera_sensor_legacy.cpp',\n+    'camera_sensor_memory.cpp',\n     'camera_sensor_properties.cpp',\n     'camera_sensor_raw.cpp',\n ])\n","prefixes":["03/11"]}