Patch Detail
Show a patch.
GET /api/1.1/patches/17024/?format=api
{ "id": 17024, "url": "https://patchwork.libcamera.org/api/1.1/patches/17024/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17024/", "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": "<20220808124848.35258-1-jacopo@jmondi.org>", "date": "2022-08-08T12:48:48", "name": "[libcamera-devel] libcamera: formats: Search V4L2 format info on map", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": true, "hash": "76eb71c73abd099e5e305966b8df7c40baf1ff24", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17024/mbox/", "series": [ { "id": 3387, "url": "https://patchwork.libcamera.org/api/1.1/series/3387/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3387", "date": "2022-08-08T12:48:48", "name": "[libcamera-devel] libcamera: formats: Search V4L2 format info on map", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3387/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17024/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17024/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 33A09C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 8 Aug 2022 12:48:59 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 728446332B;\n\tMon, 8 Aug 2022 14:48:58 +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 19CC663315\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 8 Aug 2022 14:48:57 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id E8E594000C;\n\tMon, 8 Aug 2022 12:48:55 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1659962938;\n\tbh=4SwCrGdRcrMRvCyxWwW3X2qYoK8R8txGCpLX8mt1vMA=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=itXWqY8Fx7dCpKErLTI1+Ie5d+lvF+8zBN43IcJYL4DcWwWAqajK8QI3cZz2eB5mu\n\taZv6V8nWy8TXCufLBPkBC7amnjwWnq7l35LzjUt99f1CJeNCsKjxOS3Oe8k4k+J3pk\n\tXAYnxWYSVx8JMXLXAGTtoUwjorNzmANHKXSwx7nGsQIvUHIsvzcp/nxuoDyjS4vELc\n\tl/gdQIfdq+cTuc+35EqOp43MhXYCIcX7NkjCBJCapYyDMQCAWhtahoRHG9cnueveQ3\n\tn0IdfO2flMh5lV1v9y5rzOvESpKtGpFXZ8SuwVPVuNAHcrl6YsJ3DMaIM7G4j/aJjb\n\tgqrc3YAQPf+ag==", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 8 Aug 2022 14:48:48 +0200", "Message-Id": "<20220808124848.35258-1-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.37.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: formats: Search V4L2 format\n\tinfo on map", "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": "Commit f25ad4a2b16b (\"libcamera: formats: Reimplement V4L2\nPixelFormatInfo::info()\") changed the PixelFormatInfo::info(const\nV4L2PixelFormat &format) function overload to:\n\n\treturn info(format.toPixelFormat());\n\nAfter the series that contains such commit, the PixelFormatInfo for the\npixel format applied to a video device is retrieved at\nV4L2VideoDevice::open() time. Some video devices register formats not\navailable to applications, for example metadata formats or, in the case\nof ISP devices, formats to describe the ISP statistics and parameters.\n\nThis causes the\n\n\tformat.toPixelFormat()\n\ncall to output a WARN message, which spams the log and unnecessary alert\nthe users.\n\nRestore the behaviour preceding commit f25ad4a2b16b, which in the case\na V4L2 pixel format is not registered in the map of formats known to\nlibcamera, silently returns an invalid PixelFormatInfo without\noutputting any unnecessary warning message.\n\nFixes: f25ad4a2b16b (\"libcamera: formats: Reimplement V4L2 PixelFormatInfo::info()\")\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/formats.cpp | 11 ++++++++++-\n 1 file changed, 10 insertions(+), 1 deletion(-)\n\n--\n2.37.1", "diff": "diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex 0bd0e09ae44c..51eccdce064e 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -852,7 +852,16 @@ const PixelFormatInfo &PixelFormatInfo::info(const PixelFormat &format)\n */\n const PixelFormatInfo &PixelFormatInfo::info(const V4L2PixelFormat &format)\n {\n-\treturn info(format.toPixelFormat());\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\tconst auto &formats = pair.second.v4l2Formats;\n+\t\t\t\t\t\treturn std::find(formats.begin(), formats.end(), format)\n+\t\t\t\t\t\t\t!= formats.end();\n+\t\t\t\t\t});\n+\tif (info == pixelFormatInfo.end())\n+\t\treturn pixelFormatInfoInvalid;\n+\n+\treturn info->second;\n }\n\n /**\n", "prefixes": [ "libcamera-devel" ] }