Patch Detail
Show a patch.
GET /api/patches/24242/?format=api
{ "id": 24242, "url": "https://patchwork.libcamera.org/api/patches/24242/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24242/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20250827090739.86955-6-david.plowman@raspberrypi.com>", "date": "2025-08-27T09:07:32", "name": "[RFC,05/12] libcamera: sensor: Add CameraSensorMemory class", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "3fe1ba67db3343eb13dcdaa70bc222eef12ca6b8", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24242/mbox/", "series": [ { "id": 5407, "url": "https://patchwork.libcamera.org/api/series/5407/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5407", "date": "2025-08-27T09:07:27", "name": "Bayer Re-Processing", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5407/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24242/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24242/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 D641FBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Aug 2025 09:08:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AA34E692FA;\n\tWed, 27 Aug 2025 11:07:58 +0200 (CEST)", "from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F3EDA692F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Aug 2025 11:07:47 +0200 (CEST)", "by mail-wr1-x436.google.com with SMTP id\n\tffacd0b85a97d-3c7edd71bbfso3636341f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Aug 2025 02:07:47 -0700 (PDT)", "from raspberrypi.pitowers.org\n\t([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-45b6f30fe02sm21498675e9.18.2025.08.27.02.07.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 27 Aug 2025 02:07:46 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"KKctlzDv\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1756285667; x=1756890467;\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=UzXPozUYv5GDAfASkNVE9/MfzThAtu3k+xq8xNPN7tk=;\n\tb=KKctlzDvidkFK7SBzhCXek4G1g1JIe2C56D7K1YgVUYe5nz/g1Nq73f/FBPsIZHyQD\n\teYLF5Z5S4M5MoZn5cDozJ15q0yST15rryZsBgE0XD38ayN7igcdg3p5Sr3zOFkLNoTj/\n\ty5hLCUdmGi4Y17VBY4tu74WYOighzJNZ8la6X73+l+zHzZEvj2lBFEhac/DMvQ2V0aTe\n\tRUn8uLiHdSZGLKfBH8S1E6f69uw6I7yRW/K5O1PGZWlLVmadRbMN7JUDkhaPPzU+AZWm\n\trtbYuKM7+eZ8GWWwsQwiEcfldkr3Sjib6ecr2q+3mUUEViYl3nzBczPVPl97MEpIxtdn\n\t/FPw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1756285667; x=1756890467;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=UzXPozUYv5GDAfASkNVE9/MfzThAtu3k+xq8xNPN7tk=;\n\tb=C6YNH4ygMFExeJTQdO+YbA72fADqK+Nfm/Cb2ZJ+YvW7iltfitJWt2cxJJmgLrXian\n\tySjh3ba/bPTmU7/WyhcEHouEFgLT89itSkevlFR/RlOEaWt29WXjUoaAfZa/XDi5QuH+\n\ttgiSB9/YgtoffJGc79sIyedl6D3LKvPwhyWBQ/bZeYgXIWKnValG7G10fVRnHKU64sR+\n\t4TVDysgE9e67cD4RZgUS4U+KrCga19pGdc6FP5yYGslHdjnICMwcTUMle0ZgFpxlQXNQ\n\tf14LEbmtjyhiVYZoYORBd3G9KVqNzEn+QmlFMDRlh9AJFpWqaVGwvRzDpUbHxmgISvvL\n\tJTjw==", "X-Gm-Message-State": "AOJu0Ywdhmipg8McuKVfw/Bhu+NPkuRufT0qraRvR6WAL8LqvQ3O157G\n\tdbf2iAOv3j55Iawd2w75L4/UzDMYX/ZntVCiKX3ou0J0dH0tDAmElBCRevPRGeyueV55D8HxO9f\n\tN5oLK", "X-Gm-Gg": "ASbGncsHJBYXYf1qUFfP4q+/LlHlE3PbsDX02ReFtiY6uvINA/vW/qvfnfdAT0pUzyM\n\tlEzCv/UAQfjFFCwj6fjwky+XUhzMWVZMgDlGaZlIOP/tvs3k7bmhQrSFo9yOuBhcx8e7Wc0tBas\n\tDe8kfJIy/s2x050DepALZzwv0VgQXrcTk7SFrEcqYsz6uzZ2nibHL6LnwJfrisbzRgSt4ntrpKm\n\t+nf5ktXNkkafR3cHa4MVyc/2IZg/KdSu3vrP9PAarXuGMbH++n+WzEx3kbmIeEP6YyehY9KK3BO\n\tbTfZNmOHR5lu9m0sQREQg1dP/gvjjkwnjmy/HOWCJzpTdTAsjyp/MGy87EpeN5C1MwQmbalSsqZ\n\tOPooorcznXNQSvEZhXKeqQCS8vmWORMf35T/LsV0DvvTosTgDkbyCauB7q+lfATeyfuIvgAuFTE\n\te135pYeCufdARJm4Lh+MyrOBuCuNP1UUJmHr+vJHs2uiZ6aoQZOA==", "X-Google-Smtp-Source": "AGHT+IHTxJDYbkbqL+XrgmjrdSex1k4ATWeiNZ0VWpCeSYkG/ksNWa7D00eeYqBSHsWQevtWwwgHgA==", "X-Received": "by 2002:a05:6000:43d7:b0:3c9:ad8:fec9 with SMTP id\n\tffacd0b85a97d-3c90ad9064dmr9354434f8f.58.1756285666758; \n\tWed, 27 Aug 2025 02:07:46 -0700 (PDT)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "David Plowman <david.plowman@raspberrypi.com>", "Subject": "[RFC PATCH 05/12] libcamera: sensor: Add CameraSensorMemory class", "Date": "Wed, 27 Aug 2025 10:07:32 +0100", "Message-Id": "<20250827090739.86955-6-david.plowman@raspberrypi.com>", "X-Mailer": "git-send-email 2.39.5", "In-Reply-To": "<20250827090739.86955-1-david.plowman@raspberrypi.com>", "References": "<20250827090739.86955-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 memoery buffer.\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 | 109 ++++++++\n include/libcamera/internal/meson.build | 1 +\n src/libcamera/sensor/camera_sensor_memory.cpp | 237 ++++++++++++++++++\n src/libcamera/sensor/meson.build | 1 +\n 5 files changed, 350 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 13048f32..2b719d8c 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -48,6 +48,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..4552bff7\n--- /dev/null\n+++ b/include/libcamera/internal/camera_sensor_memory.h\n@@ -0,0 +1,109 @@\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);\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(const std::vector<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+\n+\tconst ControlInfoMap &controls() const override;\n+\tControlList getControls(const std::vector<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 5c80a28c..bba9df4f 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..dcb8679f\n--- /dev/null\n+++ b/src/libcamera/sensor/camera_sensor_memory.cpp\n@@ -0,0 +1,237 @@\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)\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+\tunsigned int mbusCode = bayerFormat_.toMbusCode();\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(const std::vector<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+const ControlInfoMap &CameraSensorMemory::controls() const\n+{\n+\treturn *controls_.infoMap();\n+}\n+\n+ControlList CameraSensorMemory::getControls([[maybe_unused]] const std::vector<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": [ "RFC", "05/12" ] }