Patch Detail
Show a patch.
GET /api/1.1/patches/25188/?format=api
{ "id": 25188, "url": "https://patchwork.libcamera.org/api/1.1/patches/25188/?format=api", "web_url": "https://patchwork.libcamera.org/patch/25188/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20251125162851.2301793-10-stefan.klug@ideasonboard.com>", "date": "2025-11-25T16:28:21", "name": "[v3,09/29] libcamera: converter_v4l2_m2m: Add helper to apply controls", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "7384fdf63475df695e5e10660cdbe367a9ef9e81", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/1.1/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/25188/mbox/", "series": [ { "id": 5613, "url": "https://patchwork.libcamera.org/api/1.1/series/5613/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5613", "date": "2025-11-25T16:28:12", "name": "Full dewarper support on imx8mp", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5613/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/25188/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/25188/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 2380EC333C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Nov 2025 16:29:23 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7AB660AB1;\n\tTue, 25 Nov 2025 17:29:22 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5348960A85\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Nov 2025 17:29:21 +0100 (CET)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:bae1:340c:573c:570b])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 5571B1E2A; \n\tTue, 25 Nov 2025 17:27:12 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"oTcV64Eh\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1764088032;\n\tbh=klZ9dbavnx5ai/wUySH711DwmVvRN/fwBS7jblr1XFo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=oTcV64Ehhu4F60PZSjei/2+2cMRzUcUaOjLXIZQHP6cu1atyibikmt4xRHWY8/+zC\n\tJ7OCZ1Aq/ucn7gmEiLecT12ulZL7Ugay6UMYei2JILbORJW7QiuwVb+Hc3aUZPrOF1\n\tO2hZ/UZcbNcWsLQoGKNXYL6mCVGT1zYz5uw9SAVU=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>,\n\tUmang Jain <umang.jain@ideasonboard.com>,\n\tIsaac Scott <isaac.scott@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>", "Subject": "[PATCH v3 09/29] libcamera: converter_v4l2_m2m: Add helper to apply\n\tcontrols", "Date": "Tue, 25 Nov 2025 17:28:21 +0100", "Message-ID": "<20251125162851.2301793-10-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.51.0", "In-Reply-To": "<20251125162851.2301793-1-stefan.klug@ideasonboard.com>", "References": "<20251125162851.2301793-1-stefan.klug@ideasonboard.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": "From: Umang Jain <umang.jain@ideasonboard.com>\n\nAdd applyControls() helper to apply controls for a stream.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\nReviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\n\nChanges in v3:\n- Collected tags\n\nChanges in v2:\n- Removed stray semicolon\n- Added documentation\n\nChanges in v0.9\n- Include request support in applyControls\n---\n .../internal/converter/converter_v4l2_m2m.h | 5 +++\n .../converter/converter_v4l2_m2m.cpp | 34 +++++++++++++++++++\n 2 files changed, 39 insertions(+)", "diff": "diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\nindex bc85bff7a07b..6d2453bb9e06 100644\n--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n@@ -24,6 +24,7 @@\n \n namespace libcamera {\n \n+class ControlList;\n class FrameBuffer;\n class MediaDevice;\n class Size;\n@@ -73,6 +74,8 @@ public:\n \tstd::pair<Rectangle, Rectangle> inputCropBounds() override { return inputCropBounds_; }\n \tstd::pair<Rectangle, Rectangle> inputCropBounds(const Stream *stream) override;\n \n+\tint applyControls(const Stream *stream, ControlList &ctrls, const V4L2Request *request = nullptr);\n+\n \tint allocateRequests(unsigned int count,\n \t\t\t std::vector<std::unique_ptr<V4L2Request>> *requests);\n \n@@ -94,6 +97,8 @@ private:\n \t\tint start();\n \t\tvoid stop();\n \n+\t\tint applyControls(ControlList &ctrls, const V4L2Request *request = nullptr);\n+\n \t\tint queueBuffers(FrameBuffer *input, FrameBuffer *output,\n \t\t\t\t const V4L2Request *request = nullptr);\n \ndiff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\nindex e57db8a438ab..48e49f143cf1 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -18,6 +18,7 @@\n #include <libcamera/base/signal.h>\n #include <libcamera/base/utils.h>\n \n+#include <libcamera/controls.h>\n #include <libcamera/framebuffer.h>\n #include <libcamera/geometry.h>\n #include <libcamera/stream.h>\n@@ -251,6 +252,20 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n \tconverter_->outputBufferReady.emit(buffer);\n }\n \n+/**\n+ * \\brief Apply controls\n+ * \\param[in] ctrls The controls to apply\n+ * \\param[in] request An optional request\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ * \\see V4L2Device::setControls()\n+ */\n+int V4L2M2MConverter::V4L2M2MStream::applyControls(ControlList &ctrls,\n+\t\t\t\t\t\t const V4L2Request *request)\n+{\n+\treturn m2m_->capture()->setControls(&ctrls, request);\n+}\n+\n /* -----------------------------------------------------------------------------\n * V4L2M2MConverter\n */\n@@ -744,6 +759,25 @@ int V4L2M2MConverter::queueBuffers(FrameBuffer *input,\n \treturn 0;\n }\n \n+/**\n+ * \\brief Apply controls\n+ * \\param[in] stream The stream on which to apply the controls\n+ * \\param[in] ctrls The controls to apply\n+ * \\param[in] request An optional request\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ * \\see V4L2Device::setControls()\n+ */\n+int V4L2M2MConverter::applyControls(const Stream *stream, ControlList &ctrls,\n+\t\t\t\t const V4L2Request *request)\n+{\n+\tauto iter = streams_.find(stream);\n+\tif (iter == streams_.end())\n+\t\treturn -EINVAL;\n+\n+\treturn iter->second->applyControls(ctrls, request);\n+}\n+\n /**\n * \\copydoc libcamera::MediaDevice::allocateRequests\n */\n", "prefixes": [ "v3", "09/29" ] }