{"id":11463,"url":"https://patchwork.libcamera.org/api/1.1/patches/11463/?format=json","web_url":"https://patchwork.libcamera.org/patch/11463/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210302151111.212591-3-naush@raspberrypi.com>","date":"2021-03-02T15:11:09","name":"[libcamera-devel,v4,2/4] ipa: raspberrypi: Remove MdParserRPi","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"c02d518f2a3dde9b3c59b2262b8f1ddf98d624fd","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11463/mbox/","series":[{"id":1742,"url":"https://patchwork.libcamera.org/api/1.1/series/1742/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1742","date":"2021-03-02T15:11:07","name":"Raspberry Pi: Embedded data usage","version":4,"mbox":"https://patchwork.libcamera.org/series/1742/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11463/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11463/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 BC69EBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  2 Mar 2021 15:11:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8717B68AA3;\n\tTue,  2 Mar 2021 16:11:26 +0100 (CET)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C78A68AA1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  2 Mar 2021 16:11:24 +0100 (CET)","by mail-wm1-x329.google.com with SMTP id n22so2508943wmc.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 02 Mar 2021 07:11:24 -0800 (PST)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tw6sm7561062wrl.49.2021.03.02.07.11.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 02 Mar 2021 07:11:23 -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=\"ERNZJvRf\"; 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=rJK70tFYES6lmId9jEuXnVH3QNFhvyi2Se4PWzZ3Lm8=;\n\tb=ERNZJvRfEhN7a2wEE2slVdNArEyNGTE96aeugT0FvvDoIgQbg8noYhyEGTwwgL3DFN\n\t8FH81OxUuFXv+zpKGUblcEuZVK3U5AV+qE+2b4sGkbJQaiYUM0LmqMYOP6FGox6vU+BM\n\ttB7ju0dbWFepMlC99XRGbSOOBeg//wMJGIqKyvJaaekmCE1yeeX6cqz17rV/rtosQo2g\n\tFvGZMSDSivpqovnXw9Gi8xcBftTKKK2TfI8jtaOqMf8bgG/uHiI6pxwEF0ClMxjMs9iU\n\ty4y6z3EMFRNVi9oC+yv+nbKKOFW7h7UdGWqF9y9sTkRIc5G6pu9Lxcy8H1vPzUVD9LPn\n\tpQWQ==","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=rJK70tFYES6lmId9jEuXnVH3QNFhvyi2Se4PWzZ3Lm8=;\n\tb=iyGXeJdUzepxmwMY1JMitPII/Zy2W/7u3iHjTDXKswc4WBjGTdO37z8zyo4PEJCViS\n\to2VmJvFVM9nrvEIU41M7u4aJOsySywVxDdN8kN6XDE3ynI5+piLtFF69D6QuRcq/n6ce\n\th3STsNJxQATvb6b0rIrqYOipLE2HQIf8sY2WmoYBUWmLL+ZGvUAZSoGUhuUMvDbLlf4f\n\tWHoiM1yevcL/xX8N6+oZ1SHLMCsstvOMx1PLRDSHKkeg88u+7jhV5pYrHRuKOv3SwDnC\n\t3snacV6hXxS9b/grQeZHFTYn78I9rrNRCkMywNmB5red29qAfvHPBhbJw5uKj9o2+lXB\n\tj0NQ==","X-Gm-Message-State":"AOAM532FA4I9tDemy8h558l4WgGwQWF8bxoScqT2byeIP9kIS/OEtM4v\n\tsuXDXlFhV1plVwuD7uRwgRTYSJOG7c1PlIKV","X-Google-Smtp-Source":"ABdhPJwpQvxz2u3GFGgS3he9m98x+N3GMwH7LPEWSrm0FaHEzpO1Da2uXBe9wSK2Bbcf7YoaYK6aXw==","X-Received":"by 2002:a1c:7e85:: with SMTP id\n\tz127mr4544168wmc.131.1614697883767; \n\tTue, 02 Mar 2021 07:11:23 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  2 Mar 2021 15:11:09 +0000","Message-Id":"<20210302151111.212591-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210302151111.212591-1-naush@raspberrypi.com>","References":"<20210302151111.212591-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 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>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp        |  6 ++--\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, 6 insertions(+), 77 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..2837fcce6de5 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -88,8 +88,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","v4","2/4"]}