Show a patch.

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

{
    "id": 18387,
    "url": "https://patchwork.libcamera.org/api/patches/18387/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18387/",
    "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": "<20230313091944.9530-5-jacopo.mondi@ideasonboard.com>",
    "date": "2023-03-13T09:19:42",
    "name": "[libcamera-devel,v2,4/6] libcamera: camera_sensor: Add tryFormat()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b6934529583457b6c87ba5667f716f206b0b0a30",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18387/mbox/",
    "series": [
        {
            "id": 3803,
            "url": "https://patchwork.libcamera.org/api/series/3803/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3803",
            "date": "2023-03-13T09:19:38",
            "name": "libcamera: imx8-isi: Remove pixelformat-2-media-bus map",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3803/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18387/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18387/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 BF03EC329D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Mar 2023 09:20:09 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 467E36271C;\n\tMon, 13 Mar 2023 10:20:08 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8F98862712\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Mar 2023 10:20:04 +0100 (CET)",
            "from uno.homenet.telecomitalia.it\n\t(host-79-33-55-183.retail.telecomitalia.it [79.33.55.183])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F175C563;\n\tMon, 13 Mar 2023 10:20:03 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678699208;\n\tbh=74NT6tj49KoKhyeAa5hqxhOFn5GXnBdfSKSXaFI6R+U=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=R7KBWhilgLi9R2KH/WX2cfGi1HV931S6NhMJ+217AOWZL0G6XIUaEeQ60f7Ggiyi+\n\tNW23yIUYqKQW8xdccSq9GP7tykvjcXzv1p/bLzSx1kSNGZZdev5VKhMY/FkQYViv8h\n\tfEGnIvzZYgn29wL/w7uPe7RzkB8XQtVwiDI00qxtjmrJXUT0RKJUcMRWvAEj2rR/kG\n\toyxaGHjKNG4IsHAH+ImXAgkr46G1NjhycpJN7WeOQR1dBBpfYRZ6v1WG625rR0g1Z8\n\tEZVhkdZKlQIaeclkPuTYqGIrWiS6kU5/aS4cRIE07F89nyYRyK37vwcnYVY+1cqDDu\n\t4xJqa59aFNaxQ==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1678699204;\n\tbh=74NT6tj49KoKhyeAa5hqxhOFn5GXnBdfSKSXaFI6R+U=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=TA9wSLFMEAVmmgogrHolBIO6yJnoYOS/8DEscgGyjQ/SMgN0H/MFgXppVGX1twIqj\n\tKHqg6BeO/ZOv/svIJxfViKHcLCNHo3gtT1oT+6wohMnpC3mFuUEuD/p87/+mjqXlh4\n\tLEvYpkJ+w9aCHw1AovpLXWdS5qXswvF48t9vJb2I="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"TA9wSLFM\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 13 Mar 2023 10:19:42 +0100",
        "Message-Id": "<20230313091944.9530-5-jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.39.0",
        "In-Reply-To": "<20230313091944.9530-1-jacopo.mondi@ideasonboard.com>",
        "References": "<20230313091944.9530-1-jacopo.mondi@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 4/6] libcamera: camera_sensor: Add\n\ttryFormat()",
        "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>",
        "From": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a function to the CameraSensor class that allows to test a format\nwithout applying it to the subdevice and without modifying any control\nvalue associated with the camera sensor.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n include/libcamera/internal/camera_sensor.h |  1 +\n src/libcamera/camera_sensor.cpp            | 17 +++++++++++++++++\n 2 files changed, 18 insertions(+)",
    "diff": "diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex 928c61af7f4e..02c77ab037da 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -56,6 +56,7 @@ public:\n \t\t\t\t      const Size &size) const;\n \tint setFormat(V4L2SubdeviceFormat *format,\n \t\t      Transform transform = Transform::Identity);\n+\tint tryFormat(V4L2SubdeviceFormat *format) const;\n \n \tconst ControlInfoMap &controls() const;\n \tControlList getControls(const std::vector<uint32_t> &ids);\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex e442b89dacd0..06f315210240 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -795,6 +795,23 @@ int CameraSensor::setFormat(V4L2SubdeviceFormat *format, Transform transform)\n \treturn 0;\n }\n \n+/**\n+ * \\brief Try the sensor output format\n+ * \\param[in] format The desired sensor output format\n+ *\n+ * The ranges of any controls associated with the sensor are not updated.\n+ *\n+ * \\todo Add support for Transform by changing the format's Bayer ordering\n+ * before calling subdev_->setFormat().\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int CameraSensor::tryFormat(V4L2SubdeviceFormat *format) const\n+{\n+\treturn subdev_->setFormat(pad_, format,\n+\t\t\t\t  V4L2Subdevice::Whence::TryFormat);\n+}\n+\n /**\n  * \\brief Retrieve the supported V4L2 controls and their information\n  *\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "4/6"
    ]
}