Show a patch.

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

{
    "id": 16927,
    "url": "https://patchwork.libcamera.org/api/patches/16927/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16927/",
    "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": "<20220803103849.26144-2-jacopo@jmondi.org>",
    "date": "2022-08-03T10:38:43",
    "name": "[libcamera-devel,v5,1/7] libcamera: formats: Reimplement V4L2 PixelFormatInfo::info()",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "33fc3c57322f8bf4f1eb3ec15840785ec02fb965",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16927/mbox/",
    "series": [
        {
            "id": 3365,
            "url": "https://patchwork.libcamera.org/api/series/3365/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3365",
            "date": "2022-08-03T10:38:42",
            "name": "libcamera: Map multiple V4L2 formats to a single libcamera::format",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/3365/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16927/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16927/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 31595BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Aug 2022 10:39:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E70B261FAE;\n\tWed,  3 Aug 2022 12:39:00 +0200 (CEST)",
            "from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net\n\t[217.70.183.197])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9976A63316\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Aug 2022 12:38:58 +0200 (CEST)",
            "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 700171C0006;\n\tWed,  3 Aug 2022 10:38:57 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659523140;\n\tbh=0L61/HL1fLWRMH3JFmzeF9mO5Eyay1B9vOrN8YAy79s=;\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:\n\tFrom;\n\tb=s6t+0VEwbv0dD6O+nRdgTYEsrcKXTseFilbGDpUkJAhFNpDWkZjQApQscExEmCtjw\n\tW7N4ByDd3A+1dndInzU/QfSDl6Os199UImQ4PvF64DWwQSkOtLDm/wEcQmmF3k2D2z\n\tdqb3m+0Xruzin+lhEwteDLd9UFVWxax3jUzYtaUAB44tY7Rt0wHocxThfk0f/nT1Bk\n\t88fTclBTmXN6TRaEk91I46Tp/3saoPvc4Hur5SYZ/tftt2+8kvatEXmSxXOqhlVx2s\n\tbLmIWFjfE5LiYsqSHuJ8fdHvrHekDWOAy2IeJ3kaR2JKEW/qNlxmER+Sbu9/KPNxI+\n\tyqsECc58Fqpnw==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  3 Aug 2022 12:38:43 +0200",
        "Message-Id": "<20220803103849.26144-2-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.37.1",
        "In-Reply-To": "<20220803103849.26144-1-jacopo@jmondi.org>",
        "References": "<20220803103849.26144-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 1/7] libcamera: formats: Reimplement\n\tV4L2 PixelFormatInfo::info()",
        "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@jmondi.org>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The PixelFormatInfo::info(const V4L2PixelFormat &format) function\nreturns the PixelFormatInfo associated with a V4L2 pixel format.\n\nAs the pixelFormatInfo map is indexed using PixelFormat and a V4L2\nformat can easily be converted to a PixelFormat, simply return\nthe info() function overload instead of maintaining two similar\nimplementations of the same function.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/formats.cpp | 12 ++----------\n 1 file changed, 2 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex 283ecb3d89d8..53207b734143 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -987,22 +987,14 @@ const PixelFormatInfo &PixelFormatInfo::info(const PixelFormat &format)\n }\n \n /**\n- * \\brief Retrieve information about a pixel format\n+ * \\brief Retrieve information about a V4L2 pixel format\n  * \\param[in] format The V4L2 pixel format\n  * \\return The PixelFormatInfo describing the V4L2 \\a format if known, or an\n  * invalid PixelFormatInfo otherwise\n  */\n const PixelFormatInfo &PixelFormatInfo::info(const V4L2PixelFormat &format)\n {\n-\tconst auto &info = std::find_if(pixelFormatInfo.begin(), pixelFormatInfo.end(),\n-\t\t\t\t\t[format](auto pair) {\n-\t\t\t\t\t\treturn pair.second.v4l2Formats.single == format ||\n-\t\t\t\t\t\t       pair.second.v4l2Formats.multi == format;\n-\t\t\t\t\t});\n-\tif (info == pixelFormatInfo.end())\n-\t\treturn pixelFormatInfoInvalid;\n-\n-\treturn info->second;\n+\treturn info(format.toPixelFormat());\n }\n \n /**\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "1/7"
    ]
}