Patch Detail
Show a patch.
GET /api/patches/11338/?format=api
{ "id": 11338, "url": "https://patchwork.libcamera.org/api/patches/11338/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11338/", "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": "<20210218170126.2060783-3-naush@raspberrypi.com>", "date": "2021-02-18T17:01:24", "name": "[libcamera-devel,v3,2/4] ipa: raspberrypi: Remove MdParserRPi", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "730761b0a44ff92538855e45048047ccba9f9b32", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11338/mbox/", "series": [ { "id": 1708, "url": "https://patchwork.libcamera.org/api/series/1708/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1708", "date": "2021-02-18T17:01:22", "name": "Raspberry Pi: Embedded data usage", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1708/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11338/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11338/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 EDF1ABD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 18 Feb 2021 17:01:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2F349689C5;\n\tThu, 18 Feb 2021 18:01:35 +0100 (CET)", "from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A4E7568370\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Feb 2021 18:01:33 +0100 (CET)", "by mail-wm1-x331.google.com with SMTP id x4so4590434wmi.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Feb 2021 09:01:33 -0800 (PST)", "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tt30sm10504747wra.56.2021.02.18.09.01.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 18 Feb 2021 09:01:32 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"fOo3doD4\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=3HvJuESFWALCqMFAwUgJ9kgCVsW7NPMfzuFxlTN4+C4=;\n\tb=fOo3doD4cKGuhfawJs58hoj6sMYzOjJtqg/nGqTPpVqacZ5juOw1F3eYFjrojcObQr\n\tbZ9TbL6P0lQnluyjbT7Jtr3yAeQ1YO9pGWtpJwslLi7CP2MZphYBBdIxcIVwKyZAGri6\n\tbpcJk/UkiC/Qo0S+NrGOrL1U2pcjbLW3NLvf4lEgoe+Q932f+0H9X8V79lVB6+Re+ifM\n\tRoH8yFT3ArCEkyv311d6AnEyKPNMkL6CGqDz6cs8OicepzuPppcisrkvnQurHcocZnVO\n\tf5smFCXrkVoLdhBofxmrKpBpmhiGZ5RQEM4lPeYvm0BGxzKTo+AQqA7IQqeTU/N/1/pI\n\tiylg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=3HvJuESFWALCqMFAwUgJ9kgCVsW7NPMfzuFxlTN4+C4=;\n\tb=I0cVcDBA2vxuikcnRwxOc9b6EnWvKyN4n1/uCoJ463lfF/YAANJCeH07d65QYsMggN\n\tBG7DXzjJO02AOecVELsemVLAlgEDiPZGKzXwhNzDG0g652wBW/SasBw2DW+tqQX6/PfC\n\tJ7N2Aab+3kv0LqCrj2/Wl8ND44a+DE/CqoEPsRtohwHJixt1HNMpk3tsqOnVhKhDsuSw\n\tf0M2TZEuSoGTVij9Kqin4aAeHYewNB4vgIzp5aF1RUwjK2AL9sh2BMQD67x7zvpmhYkN\n\teWZeFzE2nEX2OTC/W1ooiXJCtUcIYUBzKoNqlN1C69MaV73cGAr9AkJs5PvpdbtMzfOw\n\tyKIg==", "X-Gm-Message-State": "AOAM532C5lGdrJtLH7FAu68aQu2JMhG4nS/d9GB2paOp1GScpN6AQE7d\n\tuWrf6yUgfkU2ZHIQWquGbA6xIUHQRSafNg7o", "X-Google-Smtp-Source": "ABdhPJyPIsg9M0Gah/mBWTU5w21yNRb31Glf0raCepkdMXDOxqfjO7Em4CE2YlHWGwX0/qO+nJqqXQ==", "X-Received": "by 2002:a05:600c:19cf:: with SMTP id\n\tu15mr4370528wmq.139.1613667692493; \n\tThu, 18 Feb 2021 09:01:32 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 18 Feb 2021 17:01:24 +0000", "Message-Id": "<20210218170126.2060783-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210218170126.2060783-1-naush@raspberrypi.com>", "References": "<20210218170126.2060783-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3 2/4] ipa: raspberrypi: Remove\n\tMdParserRPi", "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": "With the recent change to pass a ControlList to the IPA with exposure\nand gain values used for a frame, RPiController::MdParserRPi is not\nneeded any more. Remove all traces of it.\n\nThe derived CamHelper objects now pass nullptr values for the parser to\nthe base CamHelper class when sensors do not use metadata.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp | 9 ++++--\n src/ipa/raspberrypi/cam_helper_imx219.cpp | 4 +--\n src/ipa/raspberrypi/cam_helper_ov5647.cpp | 3 +-\n src/ipa/raspberrypi/md_parser_rpi.cpp | 37 -----------------------\n src/ipa/raspberrypi/md_parser_rpi.hpp | 32 --------------------\n src/ipa/raspberrypi/meson.build | 1 -\n 6 files changed, 8 insertions(+), 78 deletions(-)\n delete mode 100644 src/ipa/raspberrypi/md_parser_rpi.cpp\n delete mode 100644 src/ipa/raspberrypi/md_parser_rpi.hpp", "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 93d1b7b0296a..c9cdc39c5932 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -42,7 +42,8 @@ CamHelper::CamHelper(MdParser *parser, unsigned int frameIntegrationDiff)\n \n CamHelper::~CamHelper()\n {\n-\tdelete parser_;\n+\tif (parser_)\n+\t\tdelete parser_;\n }\n \n uint32_t CamHelper::ExposureLines(double exposure_us) const\n@@ -88,8 +89,10 @@ uint32_t CamHelper::GetVBlanking(double &exposure, double minFrameDuration,\n void CamHelper::SetCameraMode(const CameraMode &mode)\n {\n \tmode_ = mode;\n-\tparser_->SetBitsPerPixel(mode.bitdepth);\n-\tparser_->SetLineLengthBytes(0); /* We use SetBufferSize. */\n+\tif (parser_) {\n+\t\tparser_->SetBitsPerPixel(mode.bitdepth);\n+\t\tparser_->SetLineLengthBytes(0); /* We use SetBufferSize. */\n+\t}\n \tinitialized_ = true;\n }\n \ndiff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp\nindex 95b8e698fe3b..0e454d0de2dc 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n@@ -19,8 +19,6 @@\n #include \"cam_helper.hpp\"\n #if ENABLE_EMBEDDED_DATA\n #include \"md_parser.hpp\"\n-#else\n-#include \"md_parser_rpi.hpp\"\n #endif\n \n using namespace RPiController;\n@@ -62,7 +60,7 @@ CamHelperImx219::CamHelperImx219()\n #if ENABLE_EMBEDDED_DATA\n \t: CamHelper(new MdParserImx219(), frameIntegrationDiff)\n #else\n-\t: CamHelper(new MdParserRPi(), frameIntegrationDiff)\n+\t: CamHelper(nullptr, frameIntegrationDiff)\n #endif\n {\n }\ndiff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\nindex a7f417324048..75486e900d31 100644\n--- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp\n@@ -8,7 +8,6 @@\n #include <assert.h>\n \n #include \"cam_helper.hpp\"\n-#include \"md_parser_rpi.hpp\"\n \n using namespace RPiController;\n \n@@ -38,7 +37,7 @@ private:\n */\n \n CamHelperOv5647::CamHelperOv5647()\n-\t: CamHelper(new MdParserRPi(), frameIntegrationDiff)\n+\t: CamHelper(nullptr, frameIntegrationDiff)\n {\n }\n \ndiff --git a/src/ipa/raspberrypi/md_parser_rpi.cpp b/src/ipa/raspberrypi/md_parser_rpi.cpp\ndeleted file mode 100644\nindex 2b0bcfc5f034..000000000000\n--- a/src/ipa/raspberrypi/md_parser_rpi.cpp\n+++ /dev/null\n@@ -1,37 +0,0 @@\n-/* SPDX-License-Identifier: BSD-2-Clause */\n-/*\n- * Copyright (C) 2020, Raspberry Pi (Trading) Limited\n- *\n- * md_parser_rpi.cpp - Metadata parser for generic Raspberry Pi metadata\n- */\n-\n-#include <string.h>\n-\n-#include \"md_parser_rpi.hpp\"\n-\n-using namespace RPiController;\n-\n-MdParserRPi::MdParserRPi()\n-{\n-}\n-\n-MdParser::Status MdParserRPi::Parse(void *data)\n-{\n-\tif (buffer_size_bytes_ < sizeof(rpiMetadata))\n-\t\treturn ERROR;\n-\n-\tmemcpy(&metadata, data, sizeof(rpiMetadata));\n-\treturn OK;\n-}\n-\n-MdParser::Status MdParserRPi::GetExposureLines(unsigned int &lines)\n-{\n-\tlines = metadata.exposure;\n-\treturn OK;\n-}\n-\n-MdParser::Status MdParserRPi::GetGainCode(unsigned int &gain_code)\n-{\n-\tgain_code = metadata.gain;\n-\treturn OK;\n-}\ndiff --git a/src/ipa/raspberrypi/md_parser_rpi.hpp b/src/ipa/raspberrypi/md_parser_rpi.hpp\ndeleted file mode 100644\nindex 52f54f008056..000000000000\n--- a/src/ipa/raspberrypi/md_parser_rpi.hpp\n+++ /dev/null\n@@ -1,32 +0,0 @@\n-/* SPDX-License-Identifier: BSD-2-Clause */\n-/*\n- * Copyright (C) 2019, Raspberry Pi (Trading) Limited\n- *\n- * md_parser_rpi.hpp - Raspberry Pi metadata parser interface\n- */\n-#pragma once\n-\n-#include \"md_parser.hpp\"\n-\n-namespace RPiController {\n-\n-class MdParserRPi : public MdParser\n-{\n-public:\n-\tMdParserRPi();\n-\tStatus Parse(void *data) override;\n-\tStatus GetExposureLines(unsigned int &lines) override;\n-\tStatus GetGainCode(unsigned int &gain_code) override;\n-\n-private:\n-\t// This must be the same struct that is filled into the metadata buffer\n-\t// in the pipeline handler.\n-\tstruct rpiMetadata\n-\t{\n-\t\tuint32_t exposure;\n-\t\tuint32_t gain;\n-\t};\n-\trpiMetadata metadata;\n-};\n-\n-}\ndiff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\nindex 9af755259747..59e49686bc09 100644\n--- a/src/ipa/raspberrypi/meson.build\n+++ b/src/ipa/raspberrypi/meson.build\n@@ -17,7 +17,6 @@ rpi_ipa_includes = [\n rpi_ipa_sources = files([\n 'raspberrypi.cpp',\n 'md_parser.cpp',\n- 'md_parser_rpi.cpp',\n 'cam_helper.cpp',\n 'cam_helper_ov5647.cpp',\n 'cam_helper_imx219.cpp',\n", "prefixes": [ "libcamera-devel", "v3", "2/4" ] }