From patchwork Wed Jan 8 11:09:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 22469 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 D665AC32F0 for ; Wed, 8 Jan 2025 11:10:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 76C3568500; Wed, 8 Jan 2025 12:10:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="L5d962O+"; dkim-atps=neutral Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C1F65684E1 for ; Wed, 8 Jan 2025 12:10:36 +0100 (CET) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436284cdbe0so25955605e9.3 for ; Wed, 08 Jan 2025 03:10:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1736334636; x=1736939436; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IIG4zUWJV+wv/nFX9HY32UphHg0iL6nIDLZ67W++gCA=; b=L5d962O+VwoWD9mfZopcXn4VoDUHl2YpuyQdlpYt5BHyYIfbTAZbLgcKDaRWvIQ1ga SiUgyvq//9GqE5FJu+OP5dhfX1YHQHyWPqDUjauocCindJ52PEwykSUM1Po9aIpyCzza saWRFPtC8kWHlg0DRIIaAm3s0jVoeXVuS76rS8uP6dHS+QqkIY/r3+BA8QeStxe0IWe2 fNd+J7AE0+uri4QRP9r/Iu4Op8i4TcrY7WoO6n+MFFgIGCDYbQ9kkZ4ZYxakkCcq3QkD IqSgNtVcLmCpE08RflYIuqbad15kOZwu5roigcWQiGSUnz5bjwuYFGzuJfxye9gYMK3J TXdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736334636; x=1736939436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IIG4zUWJV+wv/nFX9HY32UphHg0iL6nIDLZ67W++gCA=; b=T3qxEe1i2Wvvmn5YEhRtWsJzWnWKXDfMipkMNe7swBY+NFp+PV8zl3tVFudD6lHAGP U0ZI3owprXbyNwsqnciNshhXPEN8qikXCai7ogjw1pSZtXfCnaSpXZuuIqdt28mAgTD6 CXhMC1yFJb7PXmK5jsz5hr80ZFioj+PafFN340O4N8RZDIUWIvlYtBA5y5zXKm8VT7Ug P5IoybyGuLEzQGiVozv5dA8XtxHQtfT00SoUoftSSQLTs4h0SIJUsz2MofhqxQ43MQkg sa0D6AStTsoOdeDSRaEucqwKVc5dJ6iQU6CPEZ+rbNoP1SZA6UvX1ufyZ1B5ht3RWK/K kkbA== X-Gm-Message-State: AOJu0Yxug8XycxOXoHE7cedikhXp3R3mLfyqtQEwI7OM5SffywAv5SEf HosPVAixH+W3hWaky+wQwB546y7C4U/IARYTZW7w59uoSjvhOnWh6zPafM/dACaNopsVSKf/QgH FvDY= X-Gm-Gg: ASbGncvBlZOGHKo1YQTVVIGgEQV/n4VdtFeIiwvIxmRn5jLjfUQ56ShKc/Yj/dpmzDq HWITFHhOM0U9uyBvBfu7Jee9tqEYIUw8k822Y6BYT+n5IL7BMK5LOcvpdLF6FkjVLSDpMankMsR V3Z06Amd+F/n/+ObfbNtGNjXKwVmb1IaVJ93keou062A0MWs3RVzIFtFk/ZkEr/P+PJTK+tgZj2 YsbIr8xgFW4O4nbh4ehOVUNbz0G3uyBdD4i19a/1TKICggYvYFgdGVEZjJkY55cBZKFPhB9TxX+ X-Google-Smtp-Source: AGHT+IH3P3RDTRHseoRuftKm7KXGgRY+qvE2re28yc3zFXBL8DE70VTR53pUHytM1klzg30fzmMEuA== X-Received: by 2002:a05:600c:4f14:b0:42c:aeee:e604 with SMTP id 5b1f17b1804b1-436e27170d3mr7420615e9.8.1736334635889; Wed, 08 Jan 2025 03:10:35 -0800 (PST) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2ddefcbsm17141325e9.22.2025.01.08.03.10.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 03:10:35 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Laurent Pinchart Subject: [PATCH v3 2/4] ipa: rpi: Add erase()/eraseLocked() to RPiController::Metadata Date: Wed, 8 Jan 2025 11:09:34 +0000 Message-ID: <20250108111030.3257931-3-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250108111030.3257931-1-naush@raspberrypi.com> References: <20250108111030.3257931-1-naush@raspberrypi.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" These functions erase a key/value pair from the metadata object. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/rpi/controller/metadata.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h index b884490918c7..77d3b0745059 100644 --- a/src/ipa/rpi/controller/metadata.h +++ b/src/ipa/rpi/controller/metadata.h @@ -91,6 +91,12 @@ public: data_.insert(other.data_.begin(), other.data_.end()); } + void erase(std::string const &tag) + { + std::scoped_lock lock(mutex_); + eraseLocked(tag); + } + template T *getLocked(std::string const &tag) { @@ -111,6 +117,14 @@ public: data_[tag] = std::forward(value); } + void eraseLocked(std::string const &tag) + { + auto it = data_.find(tag); + if (it == data_.end()) + return; + data_.erase(it); + } + /* * Note: use of (lowercase) lock and unlock means you can create scoped * locks with the standard lock classes.