From patchwork Mon Sep 26 09:57:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17401 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 59FCBBD16B for ; Mon, 26 Sep 2022 09:58:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 129B56225A; Mon, 26 Sep 2022 11:58:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664186291; bh=naXEqMC/INqUw+OoX1V7tmh3rdoy6RmaWlVoUDk/4qI=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vxwV42e9p+72UKk9eKa2R219MbWoZ4kTHtCJtkRlcfPbJ8r3eXuxMSLSN74XVrQHk HvgIGal8nMcGFekByFIfT0U5BVB1dAc95eoABAAxUyqwXNCnLIdW/EjxiKKFeyp56U 5vniJTkITZWpBfvCbCzRCVS/V4S5GvA7ydjUPJ+OiOT7xwH3l4p9RMtKKarZWdsRpJ 85c8qopXpMjXHKx0gXysfYz8GxzTLf8VSL16wHzVoFkQa4lMpxbLK09JyAvZSr48nj +oL609oIO/dUrmzw+CYmjHrObEP8Wr0oEljvtw2aHVtHA/bA93aCK7XXF9FDUdcPCU B1mgGePLWYzkA== Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6AA036224C for ; Mon, 26 Sep 2022 11:58:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qr4dsU6T"; dkim-atps=neutral Received: by mail-wr1-x42f.google.com with SMTP id cc5so9362273wrb.6 for ; Mon, 26 Sep 2022 02:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=bo43RPn2Wf8VvpHKyuSwKItQaXGqKlJBIO1xs6MhjIo=; b=qr4dsU6Tf1ALqHJ2s+IkeN3j2BFyR7DMdzeRHtJCvfa6dZPyr1khrkYHyRWkzQcsKu t54iq3XtFIEkP4vWt2z9cWNvy0UPxKVwOQKjTWtcvpJZbKiVgOiOfjwngKDZvkUdc2Sd 6r5JV/bPpbs6seEJQhNXimaeK37pBtudXU7+U25DYJxP3E1myqm7xmgipZeXYgzl5pW+ q7/lo0uHpD+WVL0hT/XUXs79yqHFC5kWW5aEk3jnamOlOS+Hrh60l7SW/BDmVGrW7Asy BLOz0Jl+6VRIgK+7JK0Apzswn2qtEQd+FmLrVgWILa7DXHLEs1OcDIHShfNELLT5TrNl QMtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=bo43RPn2Wf8VvpHKyuSwKItQaXGqKlJBIO1xs6MhjIo=; b=6BMJyh0jhVYHcqKzsSwLGcMRnnyk37QRGtwZW7ak1IF3ck2Ih+OzLnhGsIT95LyIF2 IuzoudCHojZ+cmLXlCZmf0jvpaq1pNw+vlX2cs2dZJCBeo0tuWPassAiWWN5zNNBRLgR 4v1nVwGT9BJeSaXGtNPikIlmlT6Crgv8Xvub3JXKpf253KmjakwGt7RLTmXnCXr+d8Zk zndAlcbS7Z5DdEic8hQ7DOp1fOcw1RuSiRhUo+5+/Skzzxe6GLXhIC0btChCixqGYX8F e/4c/wyAoi7c/i1KKEcKGXrOZjg6fUcA6hDMDIbouUwx18cb5K97HkL0hYvsJE+57wNu 1haw== X-Gm-Message-State: ACrzQf2wz6qqgAa5QXFEwapBSNchcVQuodPBMz6LrojEMSBnNTqaDNsB Z5qQg8IQYcdYCbjspFQCVzZT6AyaVf9dDBa1 X-Google-Smtp-Source: AMsMyM56F761mKbo/39DO+G5Cf1qVyhm2pva64Yw3/SkrKG+KeLCob3NiLQS0GXFXvbvaAaYHv26fg== X-Received: by 2002:a5d:5258:0:b0:229:9c2c:3120 with SMTP id k24-20020a5d5258000000b002299c2c3120mr13207766wrc.695.1664186288939; Mon, 26 Sep 2022 02:58:08 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id p22-20020a05600c419600b003a4efb794d7sm10160671wmh.36.2022.09.26.02.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 02:58:06 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 26 Sep 2022 10:57:34 +0100 Message-Id: <20220926095737.30506-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220926095737.30506-1-naush@raspberrypi.com> References: <20220926095737.30506-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/7] ipa: raspberrypi: Add RPiController::Metadata::mergeCopy 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add a new member function to RPiController::Metadata that copies unique key/value pairs from one object to the other. This is different from std::map::merge that would remove the key/value pairs from the source object. Signed-off-by: Naushir Patuck --- src/ipa/raspberrypi/controller/metadata.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ipa/raspberrypi/controller/metadata.h b/src/ipa/raspberrypi/controller/metadata.h index 0f7ebfaf4c25..ddce491784e9 100644 --- a/src/ipa/raspberrypi/controller/metadata.h +++ b/src/ipa/raspberrypi/controller/metadata.h @@ -78,6 +78,16 @@ public: data_.merge(other.data_); } + void mergeCopy(const Metadata &other) + { + std::scoped_lock lock(mutex_, other.mutex_); + /* + * If the metadata key exists, ignore this item and copy only + * unique key/value pairs. + */ + data_.insert(other.data_.begin(), other.data_.end()); + } + template T *getLocked(std::string const &tag) {