{"id":16946,"url":"https://patchwork.libcamera.org/api/1.1/patches/16946/?format=json","web_url":"https://patchwork.libcamera.org/patch/16946/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220803112640.30402-2-jacopo@jmondi.org>","date":"2022-08-03T11:26:33","name":"[libcamera-devel,v6,1/8] libcamera: formats: Reimplement V4L2 PixelFormatInfo::info()","commit_ref":"f25ad4a2b16bc8a0d44e8ca11c46f185b47c34b5","pull_url":null,"state":"accepted","archived":false,"hash":"33fc3c57322f8bf4f1eb3ec15840785ec02fb965","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16946/mbox/","series":[{"id":3368,"url":"https://patchwork.libcamera.org/api/1.1/series/3368/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3368","date":"2022-08-03T11:26:32","name":"libcamera: Map multiple V4L2 formats to a single libcamera::format","version":6,"mbox":"https://patchwork.libcamera.org/series/3368/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16946/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16946/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 B0AEDC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Aug 2022 11:26:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 75DB063317;\n\tWed,  3 Aug 2022 13:26:54 +0200 (CEST)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D04746330F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Aug 2022 13:26:53 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id C1D561BF20A;\n\tWed,  3 Aug 2022 11:26:51 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659526014;\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:Cc:\n\tFrom;\n\tb=AaIkFbjPRsAtc3NGpqmJEG8uTv1zkVGGeFmkdsRyRKg/z3NhbxchBi0inNf0N7ymt\n\t0hCtxFazT9m2ZBrLw9ZhO2sYASQI9x3w8793zMdcpVgHwt3ZneF+24GQlb6AXgqnLB\n\thJT+LpsIhQXMNixBgwd1EqQNWSins0BdoHzvB8bOuU2fovAmco4zOMaXhIJndo/ude\n\tXes5tMOfl1Hk6c/8DAAJL4rTru/cmlsVw///laKjxPN6fMqY/5rL8CjGM6xVGh44Ix\n\tez3BdHMa014f8YINKV2Tuw26ryopBhtD8Ee6HS+G2RqVitgvhK4OsRRimoOpsTy0hs\n\tvE5hswWK0kglQ==","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  3 Aug 2022 13:26:33 +0200","Message-Id":"<20220803112640.30402-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.37.1","In-Reply-To":"<20220803112640.30402-1-jacopo@jmondi.org>","References":"<20220803112640.30402-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 1/8] 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>\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","v6","1/8"]}