Patch Detail
Show a patch.
GET /api/1.1/patches/20072/?format=api
{ "id": 20072, "url": "https://patchwork.libcamera.org/api/1.1/patches/20072/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20072/", "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": "<20240519115622.32170-3-umang.jain@ideasonboard.com>", "date": "2024-05-19T11:56:20", "name": "[v2,2/4] libcamera: converter_v4l2_m2m: Support crop selection", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e159f07f9e6971a43afb82469e37863a8278a564", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20072/mbox/", "series": [ { "id": 4315, "url": "https://patchwork.libcamera.org/api/1.1/series/4315/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4315", "date": "2024-05-19T11:56:18", "name": "libcamera: rkisp1: Plumb i.MX8MP DW100 dewarper", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4315/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20072/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20072/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 53964C322E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 19 May 2024 11:56:39 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9102A6347F;\n\tSun, 19 May 2024 13:56:37 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E4B663469\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 19 May 2024 13:56:33 +0200 (CEST)", "from fedora.local (unknown\n\t[IPv6:2405:201:2015:f873:9278:2c85:fd02:c5f5])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 61B2A49E;\n\tSun, 19 May 2024 13:56:22 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"ZowIMKQ5\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1716119783;\n\tbh=ZyOTc94RM3gN+8FzYyzXlDr4n2wQ/pw8HRPfwnqXfvo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ZowIMKQ5WdOAVtQEZK996VUEnKU11PdlHLZeNVgm0F70z0HPFycEyiGxw9eMBszEp\n\tsnOEvC7LFitiicFsAmqBl0McfvI1NSxKJdKXhDGdp6MmTobICj+kkL7lFh5gYF0xDg\n\tSkOwv0CB2krJv8cxMiSSJjxaSGqH5LcAS2ZWfudw=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Umang Jain <umang.jain@ideasonboard.com>", "Subject": "[PATCH v2 2/4] libcamera: converter_v4l2_m2m: Support crop selection", "Date": "Sun, 19 May 2024 17:26:20 +0530", "Message-ID": "<20240519115622.32170-3-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.44.0", "In-Reply-To": "<20240519115622.32170-1-umang.jain@ideasonboard.com>", "References": "<20240519115622.32170-1-umang.jain@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": "Add a helper to set selection rectangle on the video node\nto support cropping and scaling capabilites.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n .../internal/converter/converter_v4l2_m2m.h | 5 ++++\n .../converter/converter_v4l2_m2m.cpp | 26 +++++++++++++++++++\n 2 files changed, 31 insertions(+)", "diff": "diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\nindex 1126050c..acc6424c 100644\n--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n@@ -29,6 +29,7 @@ class MediaDevice;\n class Size;\n class SizeRange;\n struct StreamConfiguration;\n+class Rectangle;\n class V4L2M2MDevice;\n \n class V4L2M2MConverter : public Converter\n@@ -56,6 +57,8 @@ public:\n \tint queueBuffers(FrameBuffer *input,\n \t\t\t const std::map<unsigned int, FrameBuffer *> &outputs);\n \n+\tint setSelection(unsigned int output, unsigned int target, Rectangle *rect);\n+\n private:\n \tclass Stream : protected Loggable\n \t{\n@@ -74,6 +77,8 @@ private:\n \n \t\tint queueBuffers(FrameBuffer *input, FrameBuffer *output);\n \n+\t\tint setSelection(unsigned int target, Rectangle *rect);\n+\n \tprotected:\n \t\tstd::string logPrefix() const override;\n \ndiff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\nindex d8929fc5..2d3ee257 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -155,6 +155,15 @@ int V4L2M2MConverter::Stream::queueBuffers(FrameBuffer *input, FrameBuffer *outp\n \treturn 0;\n }\n \n+int V4L2M2MConverter::Stream::setSelection(unsigned int target, Rectangle *rect)\n+{\n+\tint ret = m2m_->output()->setSelection(target, rect);\n+\tif (ret < 0)\n+\t\treturn ret;\n+\n+\treturn 0;\n+}\n+\n std::string V4L2M2MConverter::Stream::logPrefix() const\n {\n \treturn \"stream\" + std::to_string(index_);\n@@ -370,6 +379,23 @@ int V4L2M2MConverter::exportBuffers(unsigned int output, unsigned int count,\n \treturn streams_[output].exportBuffers(count, buffers);\n }\n \n+/**\n+ * \\brief Set a selection rectangle \\a rect for \\a target\n+ * \\param[in] output Index of the output stream\n+ * \\param[in] target The selection target defined by the V4L2_SEL_TGT_* flags\n+ * \\param[inout] rect The selection rectangle to be applied\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int V4L2M2MConverter::setSelection(unsigned int output, unsigned int target,\n+\t\t\t\t Rectangle *rect)\n+{\n+\tif (output >= streams_.size())\n+\t\treturn -EINVAL;\n+\n+\treturn streams_[output].setSelection(target, rect);\n+}\n+\n /**\n * \\copydoc libcamera::Converter::start\n */\n", "prefixes": [ "v2", "2/4" ] }