Patch Detail
Show a patch.
GET /api/patches/16741/?format=api
{ "id": 16741, "url": "https://patchwork.libcamera.org/api/patches/16741/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16741/", "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": "<20220723095330.43542-3-jacopo@jmondi.org>", "date": "2022-07-23T09:53:24", "name": "[libcamera-devel,v2,2/8] libcamera: formats: Search PixelFormatInfo on multiple formats", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "16e60bfe7b940d34219db1d515dd526e08797ab7", "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/16741/mbox/", "series": [ { "id": 3320, "url": "https://patchwork.libcamera.org/api/series/3320/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3320", "date": "2022-07-23T09:53:22", "name": "libcamera: Map multiple V4L2 formats to a single libcamera::format", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3320/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16741/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16741/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 8D5FEBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 23 Jul 2022 09:53:54 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 43C9F63318;\n\tSat, 23 Jul 2022 11:53: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 6C2806330E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 23 Jul 2022 11:53:53 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 98CAD1BF209;\n\tSat, 23 Jul 2022 09:53:48 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1658570034;\n\tbh=bMoHreOwzOKKMc0amupIX1iTjk8koHqdj2oVGPGBVYc=;\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=NT7yABd0KbQmChDxw6H+u4IJcFR+q3wN/FuJri+kh56dy+H2fDZG1On14V14EHWQ1\n\tqfJBAoBeXECy/6WuiyfT9lG262753pbi/za8qexSF91KWq0nkiewQp2CkSzfE+m5nP\n\tMvSGRdyf8rC9WdfwKSubQfPuxAsiSRdjIhrZDXDBT66IGnn1ucCZqU7WMBovKsWomD\n\tSExSgVtMmAquVmaJLMYSXdkGifLgaToxEf1UxlltkOySSPB69a6zGBIDiZLpUB1aZn\n\tSZf6PPRH/MAaj1p+8qMDWgczMTmlTur4x2Ry1F0ZVK9f9EJqF5SvWYFYezzb73FdNz\n\te+avTcTYTANxw==", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 23 Jul 2022 11:53:24 +0200", "Message-Id": "<20220723095330.43542-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.37.1", "In-Reply-To": "<20220723095330.43542-1-jacopo@jmondi.org>", "References": "<20220723095330.43542-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 2/8] libcamera: formats: Search\n\tPixelFormatInfo on multiple formats", "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 we prepare to associate multiple V4L2 formats to a single\nPixelFormatInfo rework the function to search the given V4L2 format\nin a list.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/formats.cpp | 15 ++++++++++++---\n 1 file changed, 12 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp\nindex f7e9adc7ff77..86fc698a0f4e 100644\n--- a/src/libcamera/formats.cpp\n+++ b/src/libcamera/formats.cpp\n@@ -994,10 +994,19 @@ const PixelFormatInfo &PixelFormatInfo::info(const PixelFormat &format)\n */\n const PixelFormatInfo &PixelFormatInfo::info(const V4L2PixelFormat &format)\n {\n+\tauto matchFormats = [&format](const std::vector<V4L2PixelFormat> &formats) {\n+\t\tconst auto &it = std::find_if(formats.begin(), formats.end(),\n+\t\t\t\t\t [&format](const V4L2PixelFormat &fmt) {\n+\t\t\t\t\t\t return format == fmt;\n+\t\t\t\t\t });\n+\n+\t\treturn it == formats.end() ? false : true;\n+\t};\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[0] == format ||\n-\t\t\t\t\t\t pair.second.v4l2Formats.multi[0] == format;\n+\t\t\t\t\t[&matchFormats](auto &pair) {\n+\t\t\t\t\t\treturn matchFormats(pair.second.v4l2Formats.single) ||\n+\t\t\t\t\t\t matchFormats(pair.second.v4l2Formats.multi);\n \t\t\t\t\t});\n \tif (info == pixelFormatInfo.end())\n \t\treturn pixelFormatInfoInvalid;\n", "prefixes": [ "libcamera-devel", "v2", "2/8" ] }