Show a patch.

GET /api/1.1/patches/20380/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20380,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20380/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20380/",
    "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": "<20240625062327.50940-3-umang.jain@ideasonboard.com>",
    "date": "2024-06-25T06:23:25",
    "name": "[v3,2/4] libcamera: converter_v4l2_m2m: Support crop selection",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "dc653151196918a146b328dc055709989f9f3e32",
    "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/20380/mbox/",
    "series": [
        {
            "id": 4414,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4414/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4414",
            "date": "2024-06-25T06:23:23",
            "name": "libcamera: rkisp1: Plumb the ConverterDW100 converter",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4414/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20380/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20380/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 1C4B1BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Jun 2024 06:23:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 723C1654B1;\n\tTue, 25 Jun 2024 08:23:39 +0200 (CEST)",
            "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 392BA654A4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Jun 2024 08:23:35 +0200 (CEST)",
            "from fedora.local (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6C5A9BEB;\n\tTue, 25 Jun 2024 08:23:12 +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=\"eSFv4YBt\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1719296593;\n\tbh=jGaENnVcS2a8D2v/LbZ9+sCU/smJ9p83j+o0lSBNcbI=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=eSFv4YBtSQWFYRHrpL3ohtGtOXyqYZNufImiz00KOH2VrkCTRZrexSqMi1Qob/E8C\n\t460PEF2kCypESGO+nERMgcLdevcNkmttqYiMSQEgIHro8PmpYJPOPxvhLDROdYNqzy\n\tKw5Y0AjfaCLC8nenuPH/4Qkf5YKQplgS43nOboYk=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Umang Jain <umang.jain@ideasonboard.com>",
        "Subject": "[PATCH v3 2/4] libcamera: converter_v4l2_m2m: Support crop selection",
        "Date": "Tue, 25 Jun 2024 11:53:25 +0530",
        "Message-ID": "<20240625062327.50940-3-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.0",
        "In-Reply-To": "<20240625062327.50940-1-umang.jain@ideasonboard.com>",
        "References": "<20240625062327.50940-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          | 27 +++++++++++++++++++\n 2 files changed, 32 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\nindex b9e59899..846e9f9e 100644\n--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n@@ -30,6 +30,7 @@ class Size;\n class SizeRange;\n class Stream;\n struct StreamConfiguration;\n+class Rectangle;\n class V4L2M2MDevice;\n \n class V4L2M2MConverter : public Converter\n@@ -57,6 +58,8 @@ public:\n \tint queueBuffers(FrameBuffer *input,\n \t\t\t const std::map<const Stream *, FrameBuffer *> &outputs);\n \n+\tint setSelection(const Stream *stream, unsigned int target, Rectangle *rect);\n+\n private:\n \tclass V4L2M2MStream : protected Loggable\n \t{\n@@ -75,6 +78,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 2e77872e..c323f677 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::V4L2M2MStream::queueBuffers(FrameBuffer *input, FrameBuffe\n \treturn 0;\n }\n \n+int V4L2M2MConverter::V4L2M2MStream::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::V4L2M2MStream::logPrefix() const\n {\n \treturn stream_->configuration().toString();\n@@ -374,6 +383,24 @@ int V4L2M2MConverter::exportBuffers(const Stream *stream, unsigned int count,\n \treturn iter->second->exportBuffers(count, buffers);\n }\n \n+/**\n+ * \\brief Set a selection rectangle \\a rect for \\a target\n+ * \\param[in] stream Pointer to 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(const Stream *stream, unsigned int target,\n+\t\t\t\t   Rectangle *rect)\n+{\n+\tauto iter = streams_.find(stream);\n+\tif (iter == streams_.end())\n+\t\treturn -EINVAL;\n+\n+\treturn iter->second->setSelection(target, rect);\n+}\n+\n /**\n  * \\copydoc libcamera::Converter::start\n  */\n",
    "prefixes": [
        "v3",
        "2/4"
    ]
}