Patch Detail
Show a patch.
GET /api/patches/16640/?format=api
{ "id": 16640, "url": "https://patchwork.libcamera.org/api/patches/16640/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16640/", "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": "<20220715135007.53574-3-jacopo@jmondi.org>", "date": "2022-07-15T13:50:02", "name": "[libcamera-devel,2/7] 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/16640/mbox/", "series": [ { "id": 3288, "url": "https://patchwork.libcamera.org/api/series/3288/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3288", "date": "2022-07-15T13:50:00", "name": "libcamera: Map multiple V4L2 formats to a single libcamera::format", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3288/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16640/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16640/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 E4905BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Jul 2022 13:50:24 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 77A1763313;\n\tFri, 15 Jul 2022 15:50:24 +0200 (CEST)", "from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::223])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C86D46330A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Jul 2022 15:50:21 +0200 (CEST)", "(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id 9CEA86000A;\n\tFri, 15 Jul 2022 13:50:20 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657893024;\n\tbh=c/6gB4SSC3yvs7YlwjXpTq0TLFezDfDgjJD+2CEst8M=;\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=q0C/tocOxbx/MOpkFI20lH5yYcoRA1e07+wlCUmF1hDTIAhaaL1X9LbSNREswxq12\n\tt0LrOuU+Na5vBVIW2YzYhFYg4JtcnCeQe3hXxzRprg035BjVLTKZCZTod51EpD1P5x\n\tyuO3w8sY8IStbz1YnmEkimaFznqjjwted8wFqOKoB4mFfJljWzPtcufOBd6sM2w4iC\n\t5QsDF9+TkMEB4yfmQSRyaKzdpkWMJvaziE0HotKhECY4S+0tFEu05p2dtczZRlxcbT\n\tLknx/cCKwqInPaflXPukExUs53/bSnX1vShPlmiHCFkAdSuwoQYpCdpGraCDXYskIz\n\tJkLRAkZRMPEYA==", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 15 Jul 2022 15:50:02 +0200", "Message-Id": "<20220715135007.53574-3-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.36.1", "In-Reply-To": "<20220715135007.53574-1-jacopo@jmondi.org>", "References": "<20220715135007.53574-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 2/7] 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", "2/7" ] }