Patch Detail
Show a patch.
GET /api/patches/11324/?format=api
{ "id": 11324, "url": "https://patchwork.libcamera.org/api/patches/11324/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11324/", "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": "<20210217125008.1588781-3-naush@raspberrypi.com>", "date": "2021-02-17T12:50:06", "name": "[libcamera-devel,v2,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/11324/mbox/", "series": [ { "id": 1703, "url": "https://patchwork.libcamera.org/api/series/1703/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1703", "date": "2021-02-17T12:50:04", "name": "Raspberry Pi: Embedded data usage", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1703/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11324/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11324/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 5BBAABD1F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Feb 2021 12:50:51 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CDE1F680F8;\n\tWed, 17 Feb 2021 13:50:49 +0100 (CET)", "from mail-wr1-x434.google.com (mail-wr1-x434.google.com\n\t[IPv6:2a00:1450:4864:20::434])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E3629602F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Feb 2021 13:50:48 +0100 (CET)", "by mail-wr1-x434.google.com with SMTP id 7so17348572wrz.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Feb 2021 04:50:48 -0800 (PST)", "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tr12sm2745281wmg.44.2021.02.17.04.50.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 17 Feb 2021 04:50:47 -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=\"as9lcl5i\"; 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=as9lcl5id7Xa2KkTbp/1XIBzEE33yy/s054WZ8giwa1N9l3h5MbSfU5mktTaRalcFA\n\t8RzfxTF5VawkYqg27i7eI/lUXTQ6+z6+luV2ZzZIP3z2Pe9docHgYahWR/c3Bf2b2BNc\n\t3bvRyrItdxN78SfT9wKe1zHdsSbJf1m8VMs/SdnN/6zIyxNhOnuPE2/OPQLBFUAnVC+I\n\t8qWXN7A9Hpmv9hjf/RAktRFL770/6jeODJVSmoS6x+yxRD9Tq6Hgf8Fz99KGLJzjxJVq\n\tn2OONVbmYJojx3YZJubnobJMXYpOON+uIZUKVcn05EHqoHIAWejrmLazhdKhNydvpUhN\n\tCZdw==", "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=GgVOnvoaxZUxCFOE1U/Ki+5f+IYeZul5MiNObBDX/2PrtVsA7sCa2U+xe156WIYFV2\n\tX3WNcyV+RMU6Dplv4mSdf6z4/gD2XlAq9vbEIdd7GSZOkUr21HyqiYLu/ZeVcHO3gV0M\n\tZDbfX04XrI1hT1TjEf6VZsz15FNqwFehalhMk4s08DBVcA69+FrLHvEexSoh9kpSTd7F\n\tAF+UYZrhVoIbdso2fN3sSXc92w1iFC6zZPuVH0VRg+LI9TGeJgalLxt0AH2wKEZYoKqx\n\tEE0ib7mau2Mvz4e4arrqYNBaBlLFZBkAdBdDLL9fBz1nx7S1oNVIorL8KER+lRuZekSI\n\t+Gyg==", "X-Gm-Message-State": "AOAM532qsqdRAeB7l22rOUKknPIOvLZ4jghSOa0QPVVclzsA52hD8q9v\n\tEPDshvS/zoUY31eaxmGqSHqOHOK5rdPOxqV3", "X-Google-Smtp-Source": "ABdhPJzszUfivlB63MPt1AOY50C9PwAx/ZnI2Mdmt5x9AUgjwiO0QDEWBpvajUAXUko3Um8ik7/7Bg==", "X-Received": "by 2002:adf:e90e:: with SMTP id f14mr212072wrm.324.1613566248019;\n\tWed, 17 Feb 2021 04:50:48 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 17 Feb 2021 12:50:06 +0000", "Message-Id": "<20210217125008.1588781-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210217125008.1588781-1-naush@raspberrypi.com>", "References": "<20210217125008.1588781-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 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", "v2", "2/4" ] }