Patch Detail
Show a patch.
GET /api/patches/16911/?format=api
{ "id": 16911, "url": "https://patchwork.libcamera.org/api/patches/16911/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16911/", "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": "<20220802160136.63075-2-jacopo@jmondi.org>", "date": "2022-08-02T16:01:31", "name": "[libcamera-devel,v4,1/6] 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/16911/mbox/", "series": [ { "id": 3359, "url": "https://patchwork.libcamera.org/api/series/3359/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3359", "date": "2022-08-02T16:01:30", "name": "libcamera: Map multiple V4L2 formats to a single libcamera::format", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3359/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16911/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16911/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 6C48CBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 2 Aug 2022 16:01:50 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2B92C63312;\n\tTue, 2 Aug 2022 18:01:50 +0200 (CEST)", "from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::222])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 186F363312\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 2 Aug 2022 18:01:48 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 59D4E40005;\n\tTue, 2 Aug 2022 16:01:46 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659456110;\n\tbh=3QqyrtdGN/a4hPej3PzAb26I1iG2MFzKEIVTjosDB0o=;\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=H6xoB4/aOT0fc2EOyb4GcfMkYshA/bZ6/qIMLHsQSIzB1HqVzepZiMiuQdR6OlxrY\n\t2JSHLbJld7Y9eO3ulgfrY1oRgUMXaZjl13CYQ7X1Cu2mY+MbXd2fWrD5/c5KI2NRgN\n\tTJCKWzzvCMwyfMWzLJ1iMgcsKnOWwdcnjygNOO3c2f8xMdZrT1dPZ/U1kAcSZAX5jx\n\tpzTYSuD0FKYqfrXHE8TaqlpDPqrCCvuymPxfaUGO3i4ed+4H7m5o3AwhOY2abt7bV/\n\tgDTCK5fJAUOAAP96IqMovChmcyaL4qm7d9BuWtIrE+HMYN3MF3TJ/0ZJLq2mDVzCi+\n\tmKm6bu2hRN8jg==", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 2 Aug 2022 18:01:31 +0200", "Message-Id": "<20220802160136.63075-2-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.37.1", "In-Reply-To": "<20220802160136.63075-1-jacopo@jmondi.org>", "References": "<20220802160136.63075-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 1/6] 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>", "Cc": "jozef@mlich.cz, Pavel Machek <pavel@ucw.cz>", "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>\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", "v4", "1/6" ] }