From patchwork Fri Jan 22 10:22:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10952 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 1DB86BD808 for ; Fri, 22 Jan 2021 10:22:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D64696823F; Fri, 22 Jan 2021 11:22:25 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ijLXNe1O"; dkim-atps=neutral Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B097668232 for ; Fri, 22 Jan 2021 11:22:24 +0100 (CET) Received: by mail-wr1-x42d.google.com with SMTP id a1so4546863wrq.6 for ; Fri, 22 Jan 2021 02:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eYCFwN9iPZG8Rn3ef6s71zt26AGyTT1IJuHDcl/GAew=; b=ijLXNe1O74bXvKrx+I3MpyWVlo2ywZrUTWw9AdxNhtTr+F434FH0K+l/00/ySuZ/JP f+fq+huC2+5V7F5zk777qgRxJOBxp5GHMfdldEywTPSCo0nBUl9C+jRzhfcAbxEsyozb YMliHxQSwbj5zvXlIg/BHsi1cWPNmasEFtk/V6TEk3MfBEHkb2Lr2cW7RYa6KgSHZjI7 vPkr2OjdS4LHOhGphNaLnv5f/bCaiDTinp0yzR/f0xZUNZ1yQevSn+xMmRPzXPAXo5zB dxufCVhmAhd7PeYpdykv2fT2cBnm2GC5TUDOUQ/4nn0DZIKCpBo5xPTL5wmw1O/JI5Bd Bubg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eYCFwN9iPZG8Rn3ef6s71zt26AGyTT1IJuHDcl/GAew=; b=cud8l3L0fiHs++w0vao+4aT+vKPpxGVt1cx7QmJOJoBmOlZsvU9gBqzvOkwetoDasA POdiRUWUR6x4cCL7kzkXFNvKcbyiV8pRWrX6upEQFROG4a84Ka9fwrhPNqY5omzG6F5U 7z0oTS20mwK6IQ6YrNnqf6O56luE1AZKuqHNfCMugDhs7AAx981zAail+pPGObIGrjK2 W9Q0UnlL+NX0yyYon/xLXyFbYm9xDPN7bjvAsUltuWr6egQ2K5Y1qP+PFi4K8rne6jVD Wb1baF01w9nlYh8p6jtWVNbRD5+IAInl1ATFi9CfPwOUPzVP9AtPRiuo2K6y9AuFv7c1 1R3Q== X-Gm-Message-State: AOAM533En6lMDgwv7LMnupAKdNr1VfOhDahGDiAVzbwTwad8lhLaZ1+r ehOBZXL4ZtC5C1N8hhQEHccKwQDY1eVhlQx4 X-Google-Smtp-Source: ABdhPJxJL7CbY3kdwFP3DypbyJoUtK3I2AahMvNaGe9JMsCY5ADnsRG73MRQBlET/WHAbs/qBH/1Dg== X-Received: by 2002:a5d:5283:: with SMTP id c3mr90872wrv.319.1611310944215; Fri, 22 Jan 2021 02:22:24 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id p15sm11469221wrt.15.2021.01.22.02.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jan 2021 02:22:23 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Fri, 22 Jan 2021 10:22:07 +0000 Message-Id: <20210122102211.12768-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210122102211.12768-1-david.plowman@raspberrypi.com> References: <20210122102211.12768-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/5] ipa: raspberrypi: controller: Replace Raspberry Pi debug with libcamera debug X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Signed-off-by: David Plowman --- src/ipa/raspberrypi/controller/controller.cpp | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/ipa/raspberrypi/controller/controller.cpp b/src/ipa/raspberrypi/controller/controller.cpp index 22461cc4..f81707c2 100644 --- a/src/ipa/raspberrypi/controller/controller.cpp +++ b/src/ipa/raspberrypi/controller/controller.cpp @@ -5,6 +5,8 @@ * controller.cpp - ISP controller */ +#include "libcamera/internal/log.h" + #include "algorithm.hpp" #include "controller.hpp" @@ -12,6 +14,9 @@ #include using namespace RPiController; +using namespace libcamera; + +LOG_DEFINE_CATEGORY(RPiController) Controller::Controller() : switch_mode_called_(false) {} @@ -27,7 +32,7 @@ Controller::~Controller() {} void Controller::Read(char const *filename) { - RPI_LOG("Controller starting"); + LOG(RPiController, Debug) << "Controller starting"; boost::property_tree::ptree root; boost::property_tree::read_json(filename, root); for (auto const &key_and_value : root) { @@ -36,10 +41,10 @@ void Controller::Read(char const *filename) algo->Read(key_and_value.second); algorithms_.push_back(AlgorithmPtr(algo)); } else - RPI_LOG("WARNING: No algorithm found for \"" - << key_and_value.first << "\""); + LOG(RPiController, Debug) << "WARNING: No algorithm found for \"" + << key_and_value.first << "\""; } - RPI_LOG("Controller finished"); + LOG(RPiController, Debug) << "Controller finished"; } Algorithm *Controller::CreateAlgorithm(char const *name) @@ -50,39 +55,39 @@ Algorithm *Controller::CreateAlgorithm(char const *name) void Controller::Initialise() { - RPI_LOG("Controller starting"); + LOG(RPiController, Debug) << "Controller starting"; for (auto &algo : algorithms_) algo->Initialise(); - RPI_LOG("Controller finished"); + LOG(RPiController, Debug) << "Controller finished"; } void Controller::SwitchMode(CameraMode const &camera_mode, Metadata *metadata) { - RPI_LOG("Controller starting"); + LOG(RPiController, Debug) << "Controller starting"; for (auto &algo : algorithms_) algo->SwitchMode(camera_mode, metadata); switch_mode_called_ = true; - RPI_LOG("Controller finished"); + LOG(RPiController, Debug) << "Controller finished"; } void Controller::Prepare(Metadata *image_metadata) { - RPI_LOG("Controller::Prepare starting"); + LOG(RPiController, Debug) << "Controller::Prepare starting"; assert(switch_mode_called_); for (auto &algo : algorithms_) if (!algo->IsPaused()) algo->Prepare(image_metadata); - RPI_LOG("Controller::Prepare finished"); + LOG(RPiController, Debug) << "Controller::Prepare finished"; } void Controller::Process(StatisticsPtr stats, Metadata *image_metadata) { - RPI_LOG("Controller::Process starting"); + LOG(RPiController, Debug) << "Controller::Process starting"; assert(switch_mode_called_); for (auto &algo : algorithms_) if (!algo->IsPaused()) algo->Process(stats, image_metadata); - RPI_LOG("Controller::Process finished"); + LOG(RPiController, Debug) << "Controller::Process finished"; } Metadata &Controller::GetGlobalMetadata()