From patchwork Tue Jun 15 14:42:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 12604 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 15D3CC3218 for ; Tue, 15 Jun 2021 14:42:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 551506894C; Tue, 15 Jun 2021 16:42:17 +0200 (CEST) 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="gxKVQPIt"; dkim-atps=neutral Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B5596029D for ; Tue, 15 Jun 2021 16:42:15 +0200 (CEST) Received: by mail-wr1-x42e.google.com with SMTP id q5so18664249wrm.1 for ; Tue, 15 Jun 2021 07:42:15 -0700 (PDT) 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=Mx3ZUrPxq8qf2W8C1qUdwxUjpRrwA0SfOt3vj/8i03E=; b=gxKVQPItvlmPvLnNeE/hg4VHmzDYV7nCMXmcc8jWoVeQ0QHA1vEEUXN7xCcOo/cnQh t0m2Bt6ptCyq5jXWGRf9/6oAjzdskqq4z16kCu+6B0mlrPZHzDzJYDhFc+TMpQbSDOQ1 X/VcHec7XAZ5AWGZrSLXrHLVDORc5/IRKG3XBejnJsdigyA+7JnjH0YsWbd8s+E3WZWZ nghSHZiWSI5v7iSkHbA/3RsuqSxhO98RXAC3SlN4Fw/b7hQxn5aAOCXXeSEJgTtXqvTd HlCBgcJzL3ho2M2ZTZ0E/LqgphEmWcHYYdefrDNXlpuXXRPS43UBokb5Gwn6oVYUZD6L ie7A== 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=Mx3ZUrPxq8qf2W8C1qUdwxUjpRrwA0SfOt3vj/8i03E=; b=aclFIZ7MR0m6nza/L5aNOvjhoVyp2xftfB6LJH1cp2l8c3xrnRPpSNpS0rfwd1MjnJ +8QDxZ6dy0EbV87jOu251gUPzRtZY0xts5sl0BvzWfZwhnNVT8wbLooQKvl9x5OI61rX /efIWKp/uaquewNb0DQOjDch10C8obGBGcc29gV2tpaUWcTtHu4vbfQFg1dV0/2bxjy/ UWQFrzellEwJziOyRX3xCDgXkdoYM3zPjhQ2XABXhW8BQg4N5Ak4IQ/Fk0ZqjSI0pzT4 ydsokvkeSW+Gcw53FPMNERq5GtLpNe8UvPajA0omDCaHmgNazLjU+MrGgrMmwxasCclp eiTA== X-Gm-Message-State: AOAM533BjXa9mN1rqF7MAEtaVlo+O20/nqGh63mYe/dAxcVgKoAQjpiq k9KERt5wy60hhWNAWR+6MhZnOSKikRVW3A== X-Google-Smtp-Source: ABdhPJwhJY+uwun6jh4DGnOJMeClLNziatgx2KeG8ebstrh3qyjZN7uYruBQB2JrlgM0/2KvMErAZw== X-Received: by 2002:a5d:6d8c:: with SMTP id l12mr26371380wrs.189.1623768134887; Tue, 15 Jun 2021 07:42:14 -0700 (PDT) Received: from naush-laptop.pitowers.org ([2a00:1098:3142:14:5904:b958:1fd:d555]) by smtp.gmail.com with ESMTPSA id k12sm2441142wmr.2.2021.06.15.07.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Jun 2021 07:42:14 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 15 Jun 2021 15:42:09 +0100 Message-Id: <20210615144211.173047-2-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210615144211.173047-1-naush@raspberrypi.com> References: <20210615144211.173047-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] ipa: raspberrypi: Embed the metadata parser in the sensor CamHelper classes 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" This avoids the need for any dynamic allocations and lifetime management. The base CamHelper class still accesses the parser through a pointer that is setup by the derived class constructor. Signed-off-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper.cpp | 1 - src/ipa/raspberrypi/cam_helper_imx219.cpp | 4 +++- src/ipa/raspberrypi/cam_helper_imx477.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index 062e94c4fef3..1474464c9257 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -48,7 +48,6 @@ CamHelper::CamHelper(MdParser *parser, unsigned int frameIntegrationDiff) CamHelper::~CamHelper() { - delete parser_; } void CamHelper::Prepare(Span buffer, diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp index ec218dce5456..d951cd552a21 100644 --- a/src/ipa/raspberrypi/cam_helper_imx219.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp @@ -54,11 +54,13 @@ private: * in units of lines. */ static constexpr int frameIntegrationDiff = 4; + + MdParserImx219 imx219_parser; }; CamHelperImx219::CamHelperImx219() #if ENABLE_EMBEDDED_DATA - : CamHelper(new MdParserImx219(), frameIntegrationDiff) + : CamHelper(&imx219_parser, frameIntegrationDiff) #else : CamHelper(nullptr, frameIntegrationDiff) #endif diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp index 25b36bce0dac..44f030ed7da9 100644 --- a/src/ipa/raspberrypi/cam_helper_imx477.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp @@ -47,10 +47,12 @@ private: * in units of lines. */ static constexpr int frameIntegrationDiff = 22; + + MdParserImx477 imx477_parser; }; CamHelperImx477::CamHelperImx477() - : CamHelper(new MdParserImx477(), frameIntegrationDiff) + : CamHelper(&imx477_parser, frameIntegrationDiff) { }