From patchwork Fri Dec 6 16:07:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 22231 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 5AA5DBE173 for ; Fri, 6 Dec 2024 16:08:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5DAC467E32; Fri, 6 Dec 2024 17:08:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="l4t4zwog"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C0A2B67E23 for ; Fri, 6 Dec 2024 17:07:56 +0100 (CET) Received: from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 20B9CB2B; Fri, 6 Dec 2024 17:07:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733501247; bh=0JI3J9rPo6b0oNYB/P6YFJNiSKC94wj9/MyHeBre318=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4t4zwog3VDxY628BcnWb7A5DfAs2+XPeB3aWwHVDl8GDZWtwEnZ//fOV4QQTHq5D JOxdySRpDw6whOI+0fId9w4BlRfxOK1fUp/UDkbFo30Y6PphyVVeA2WjJAfpw3n1GF 4ii3JUXWstGu75j/RAu7m228P9yfJXR2UM/N88R4= From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , Harvey Yang , Han-Lin Chen Subject: [PATCH 5/8] libcamera: request: Add function to reset metadata Date: Fri, 6 Dec 2024 17:07:43 +0100 Message-ID: <20241206160747.97176-6-jacopo.mondi@ideasonboard.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206160747.97176-1-jacopo.mondi@ideasonboard.com> References: <20241206160747.97176-1-jacopo.mondi@ideasonboard.com> MIME-Version: 1.0 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" In order to prepare to restrict access to the metadata list stored in a request, provide a function that allows pipeline handlers to reset the metadata pack. The only user is at the moment the vc4 pipeline handler. Signed-off-by: Jacopo Mondi --- include/libcamera/internal/request.h | 5 +++++ src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h index 4e7d05b1e028..98b7c6d6dfdf 100644 --- a/include/libcamera/internal/request.h +++ b/include/libcamera/internal/request.h @@ -40,6 +40,11 @@ public: void cancel(); void reset(); + void resetMetadata() + { + _o()->metadata().clear(); + } + void prepare(std::chrono::milliseconds timeout = 0ms); Signal<> prepared; diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index fd8d84b14f15..bddc8a87d9e1 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -945,7 +945,7 @@ void Vc4CameraData::tryRunPipeline() * related controls. We clear it first because the request metadata * may have been populated if we have dropped the previous frame. */ - request->metadata().clear(); + request->_d()->resetMetadata(); fillRequestMetadata(bayerFrame.controls, request); /* Set our state to say the pipeline is active. */