Patch Detail
Show a patch.
GET /api/patches/11025/?format=api
{ "id": 11025, "url": "https://patchwork.libcamera.org/api/patches/11025/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11025/", "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": "<20210126184854.46156-3-sebastian.fricke@posteo.net>", "date": "2021-01-26T18:48:51", "name": "[libcamera-devel,v3,2/5] libcamera: Remove unnecessary constructor", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "fa13549a50da50e6f210fd3b9629321a1c849411", "submitter": { "id": 78, "url": "https://patchwork.libcamera.org/api/people/78/?format=api", "name": "Sebastian Fricke", "email": "sebastian.fricke@posteo.net" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11025/mbox/", "series": [ { "id": 1613, "url": "https://patchwork.libcamera.org/api/series/1613/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1613", "date": "2021-01-26T18:48:49", "name": "Improve BayerFormat class", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1613/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11025/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11025/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 9095FC0F2B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Jan 2021 18:49:13 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 623A268325;\n\tTue, 26 Jan 2021 19:49:13 +0100 (CET)", "from mout02.posteo.de (mout02.posteo.de [185.67.36.66])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 91E1D68318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 19:49:11 +0100 (CET)", "from submission (posteo.de [89.146.220.130]) \n\tby mout02.posteo.de (Postfix) with ESMTPS id 308AF240102\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Jan 2021 19:49:11 +0100 (CET)", "from customer (localhost [127.0.0.1])\n\tby submission (posteo.de) with ESMTPSA id 4DQG3p2JMYz6tmb;\n\tTue, 26 Jan 2021 19:49:10 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=posteo.net header.i=@posteo.net\n\theader.b=\"ORVEw45n\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;\n\tt=1611686951; bh=UgHDgb/71kG2zzqdTX3HyhKfUPPnvJv+f1MZXScVXY0=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=ORVEw45n5BWWh99XCe7cRU2v+WOQrIzLoZLLQEppmdY3wqXGpPYSgUVYyKz5wLIqH\n\tk5vVv4pOyfgL90itXeNkjVDMKOLd7gfD3xNaWa+zTtCd2p/vyh4Ozky7BOB/CpmJiZ\n\t3f2p/Pyyqw71rsSsutmgmlMtmz0sdFRh7FD/Lj8qzQBAmv9EuwE1nyZNOP/gT4PDFV\n\tK8wskGcseH2F9gKwtA4joPX2YLL1FGvcOBrkcYBwF42GPqjIYf6mKGKuu3bN6p9OGn\n\tKUcKrd1BLOeYT2FA1yscTTTRVovofn7tV2OThzpFaDMT7KhhJ819YDAM0LKYUYTMaQ\n\tJoqJ5wEK3QdwQ==", "From": "Sebastian Fricke <sebastian.fricke@posteo.net>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 26 Jan 2021 19:48:51 +0100", "Message-Id": "<20210126184854.46156-3-sebastian.fricke@posteo.net>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210126184854.46156-1-sebastian.fricke@posteo.net>", "References": "<20210126184854.46156-1-sebastian.fricke@posteo.net>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3 2/5] libcamera: Remove unnecessary\n\tconstructor", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The new `fromV4l2PixelFormat` static member function renders\nan old BayerFormat constructor useless, remove it together\nwith the `v4l2ToBayer` mapping table.\nThe new function searches for a matching mapped value instead\nof a matching key, therefore the `bayerToV4l2` table is sufficient.\n\nSigned-off-by: Sebastian Fricke <sebastian.fricke@posteo.net>\n---\n include/libcamera/internal/bayer_format.h | 1 -\n src/libcamera/bayer_format.cpp | 45 -----------------------\n 2 files changed, 46 deletions(-)", "diff": "diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h\nindex 4f338bd7..62814154 100644\n--- a/include/libcamera/internal/bayer_format.h\n+++ b/include/libcamera/internal/bayer_format.h\n@@ -42,7 +42,6 @@ public:\n \t{\n \t}\n \n-\texplicit BayerFormat(V4L2PixelFormat v4l2Format);\n \tstatic const BayerFormat &fromMbusCode(unsigned int mbusCode);\n \tbool isValid() const { return bitDepth != 0; }\n \ndiff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp\nindex 9eb83898..1acf91d4 100644\n--- a/src/libcamera/bayer_format.cpp\n+++ b/src/libcamera/bayer_format.cpp\n@@ -61,37 +61,6 @@ namespace libcamera {\n \n namespace {\n \n-const std::map<V4L2PixelFormat, BayerFormat> v4l2ToBayer{\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR8), { BayerFormat::BGGR, 8, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG8), { BayerFormat::GBRG, 8, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG8), { BayerFormat::GRBG, 8, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB8), { BayerFormat::RGGB, 8, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10), { BayerFormat::BGGR, 10, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10), { BayerFormat::GBRG, 10, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10), { BayerFormat::GRBG, 10, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10), { BayerFormat::RGGB, 10, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P), { BayerFormat::BGGR, 10, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P), { BayerFormat::GBRG, 10, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P), { BayerFormat::GRBG, 10, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P), { BayerFormat::RGGB, 10, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10), { BayerFormat::BGGR, 10, BayerFormat::IPU3Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGBRG10), { BayerFormat::GBRG, 10, BayerFormat::IPU3Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SGRBG10), { BayerFormat::GRBG, 10, BayerFormat::IPU3Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SRGGB10), { BayerFormat::RGGB, 10, BayerFormat::IPU3Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12), { BayerFormat::BGGR, 12, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12), { BayerFormat::GBRG, 12, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12), { BayerFormat::GRBG, 12, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12), { BayerFormat::RGGB, 12, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12P), { BayerFormat::BGGR, 12, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12P), { BayerFormat::GBRG, 12, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG12P), { BayerFormat::GRBG, 12, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB12P), { BayerFormat::RGGB, 12, BayerFormat::CSI2Packed } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR16), { BayerFormat::BGGR, 16, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG16), { BayerFormat::GBRG, 16, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SGRBG16), { BayerFormat::GRBG, 16, BayerFormat::None } },\n-\t{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB16), { BayerFormat::RGGB, 16, BayerFormat::None } },\n-};\n-\n /* Define a slightly arbitrary ordering so that we can use a std::map. */\n struct BayerFormatComparator {\n \tconstexpr bool operator()(const BayerFormat &lhs, const BayerFormat &rhs) const\n@@ -194,20 +163,6 @@ const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{\n * \\param[in] p The type of packing applied to the pixel values\n */\n \n-/**\n- * \\brief Construct a BayerFormat from a V4L2PixelFormat\n- * \\param[in] v4l2Format The raw format to convert into a BayerFormat\n- */\n-BayerFormat::BayerFormat(V4L2PixelFormat v4l2Format)\n-\t: order(BGGR), packing(None)\n-{\n-\tconst auto it = v4l2ToBayer.find(v4l2Format);\n-\tif (it == v4l2ToBayer.end())\n-\t\tbitDepth = 0;\n-\telse\n-\t\t*this = it->second;\n-}\n-\n /**\n * \\brief Retrieve the BayerFormat associated with a media bus code\n * \\param[in] mbusCode The media bus code to convert into a BayerFormat\n", "prefixes": [ "libcamera-devel", "v3", "2/5" ] }