{"id":14155,"url":"https://patchwork.libcamera.org/api/1.1/patches/14155/?format=json","web_url":"https://patchwork.libcamera.org/patch/14155/","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":"<20211015015804.11758-2-laurent.pinchart@ideasonboard.com>","date":"2021-10-15T01:58:04","name":"[libcamera-devel,2/2] ipa: ipu3: agc: Remove \"using\" directive from agc.h header","commit_ref":"3b07397f0e7d93d54535d9c87e7b9c19d04c97f0","pull_url":null,"state":"accepted","archived":false,"hash":"05b23399a8db2126b1f24224de4e81a9844c56ee","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14155/mbox/","series":[{"id":2630,"url":"https://patchwork.libcamera.org/api/1.1/series/2630/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2630","date":"2021-10-15T01:58:03","name":"[libcamera-devel,1/2] ipa: ipu3: awb: Don't pass member variable to member function","version":1,"mbox":"https://patchwork.libcamera.org/series/2630/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14155/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14155/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 0E712C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Oct 2021 01:58:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D448268F52;\n\tFri, 15 Oct 2021 03:58:26 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB27B68F4F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Oct 2021 03:58:24 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 618E8B91;\n\tFri, 15 Oct 2021 03:58:24 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"S6r3khiY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1634263104;\n\tbh=7RLfVZI2/69O9jDyHPlWttlJmBIUPK6ylSME+R9PYN4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=S6r3khiY9o7Z+e2b4pFR+aX3D4HuEXiKjaNhiauqREkAuLIlY2dl6p2k8WEEemcz7\n\tVKOvHy6f8ti6PKw+U42oP7VDPxIDTqFa8JQ2f4Pvj3ElPzO0EChUj/E1sJHukuPJ49\n\toFwvsYKl0L73FknaYdaAs5paVl0en0r8TPvNhl1Q=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 15 Oct 2021 04:58:04 +0300","Message-Id":"<20211015015804.11758-2-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20211015015804.11758-1-laurent.pinchart@ideasonboard.com>","References":"<20211015015804.11758-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Remove \"using\"\n\tdirective from agc.h header","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"\"using\" directives are harmful in headers, as they propagate the\nnamespace short-circuit to all files that include the header, directly\nor indirectly. Drop the directive from agc.h, and use utils::Duration\nexplicitly. While at it, shorten the namespace qualifier from\nlibcamera::utils:: to utils:: in agc.cpp for Duration.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/ipu3/algorithms/agc.cpp |  6 +++---\n src/ipa/ipu3/algorithms/agc.h   | 14 ++++++--------\n 2 files changed, 9 insertions(+), 11 deletions(-)","diff":"diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp\nindex 5eafe82ca404..970ec42419cc 100644\n--- a/src/ipa/ipu3/algorithms/agc.cpp\n+++ b/src/ipa/ipu3/algorithms/agc.cpp\n@@ -140,20 +140,20 @@ void Agc::lockExposureGain(uint32_t &exposure, double &gain)\n \t\tdouble newGain = kEvGainTarget * knumHistogramBins / iqMean_;\n \n \t\t/* extracted from Rpi::Agc::computeTargetExposure */\n-\t\tlibcamera::utils::Duration currentShutter = exposure * lineDuration_;\n+\t\tutils::Duration currentShutter = exposure * lineDuration_;\n \t\tcurrentExposureNoDg_ = currentShutter * gain;\n \t\tLOG(IPU3Agc, Debug) << \"Actual total exposure \" << currentExposureNoDg_\n \t\t\t\t    << \" Shutter speed \" << currentShutter\n \t\t\t\t    << \" Gain \" << gain;\n \t\tcurrentExposure_ = currentExposureNoDg_ * newGain;\n-\t\tlibcamera::utils::Duration maxTotalExposure = maxExposureTime_ * kMaxGain;\n+\t\tutils::Duration maxTotalExposure = maxExposureTime_ * kMaxGain;\n \t\tcurrentExposure_ = std::min(currentExposure_, maxTotalExposure);\n \t\tLOG(IPU3Agc, Debug) << \"Target total exposure \" << currentExposure_;\n \n \t\t/* \\todo: estimate if we need to desaturate */\n \t\tfilterExposure();\n \n-\t\tlibcamera::utils::Duration newExposure = 0.0s;\n+\t\tutils::Duration newExposure = 0.0s;\n \t\tif (currentShutter < maxExposureTime_) {\n \t\t\texposure = std::clamp(static_cast<uint32_t>(exposure * currentExposure_ / currentExposureNoDg_), kMinExposure, kMaxExposure);\n \t\t\tnewExposure = currentExposure_ / exposure;\ndiff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h\nindex 64b71c65ef00..e0c315fc126c 100644\n--- a/src/ipa/ipu3/algorithms/agc.h\n+++ b/src/ipa/ipu3/algorithms/agc.h\n@@ -21,8 +21,6 @@ struct IPACameraSensorInfo;\n \n namespace ipa::ipu3::algorithms {\n \n-using utils::Duration;\n-\n class Agc : public Algorithm\n {\n public:\n@@ -43,13 +41,13 @@ private:\n \n \tdouble iqMean_;\n \n-\tDuration lineDuration_;\n-\tDuration maxExposureTime_;\n+\tutils::Duration lineDuration_;\n+\tutils::Duration maxExposureTime_;\n \n-\tDuration prevExposure_;\n-\tDuration prevExposureNoDg_;\n-\tDuration currentExposure_;\n-\tDuration currentExposureNoDg_;\n+\tutils::Duration prevExposure_;\n+\tutils::Duration prevExposureNoDg_;\n+\tutils::Duration currentExposure_;\n+\tutils::Duration currentExposureNoDg_;\n \n \tuint32_t stride_;\n };\n","prefixes":["libcamera-devel","2/2"]}