From patchwork Wed Oct 19 09:01:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17629 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 B23F7C0DA4 for ; Wed, 19 Oct 2022 09:01:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C173262E4F; Wed, 19 Oct 2022 11:01:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1666170082; 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=onnfr8lZTCy5FjwPPsP0l8NsiswES8DO4CNh71n4fv0Gs21sF6tOOf1u8Ahu+TwqB OAW+UD2pkQBzkOFEOdJuFa/y00gW/o9yRuRguhO8L2A1xM0PjXeUDY0/Q1cTC8EmOs y/H3hMGNJ4awwW/y1h4EaRIWTZV+9BanBZWz5dJARNyZ9+oKEsBECKjW4wycbgCk2A 2zcUR6ADlHxVvFtbSwg3x1HDKP7y2e4R5oBRSs5OILJjwzhv7QQD7oqjD+IsK4wnZO NV5eUs8LloqVz2r4iRsTgQ3AdB1/7+o+IrWy/m82MnVJ79Tv3NePKAfSqT2iVf4haF DPnEmoEDKlVEw== Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 06D8462E44 for ; Wed, 19 Oct 2022 11:01:21 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="H5UO7zd6"; dkim-atps=neutral Received: by mail-wm1-x329.google.com with SMTP id e18so12482035wmq.3 for ; Wed, 19 Oct 2022 02:01:21 -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 :message-id:reply-to; bh=bo43RPn2Wf8VvpHKyuSwKItQaXGqKlJBIO1xs6MhjIo=; b=H5UO7zd636sPFw22zGTqQMyGm2lSC5UHy51T0AcTb/RSDIM9PXGDh7LwEe9oHJW94t C9DpNuI/zuZtAxaGHMXgOBTsZQuXAk7b3vXfqpIasBrNXM+9D1Bq8IVm/UByiJmMtM+P Xtu+/PQgwfeNjBgiM3T/fSLjdCzUPmHDfOQwu0GPtXRldeUo0e9PbFZX680uWXa3kV08 CgqUjMAxAxe7Qk/83Jy2Oxg0tM6bqFi6YmRDonh1sMAatLuqJIc0E0HCBZPb8bTQbyVo YDcA81ozIN3u9IWW+zcdmKOINndpP6rrQJLU57aOSJegnmijyjdn8IHLWlp+wAjpNCxx 27Fw== 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:message-id:reply-to; bh=bo43RPn2Wf8VvpHKyuSwKItQaXGqKlJBIO1xs6MhjIo=; b=NHA0Fu22RVtm36wzxdJCPiD2Oy/Hfjc5gLeCBE+//i/gWjDBqAqzZEfw9VoJFJztMh rDNGEXLLWdpuTKWkXVWakh5MBfSGUTUEv8irjLsx6RXf0+gzLf4gb8HT27vRGL0Xwhat ifiUh25dWfH4we3tXD4cFt8CzjBkw8a9eW96ecQe/dwvGOO2AnHzh8Rerjj3w+6tyVpB u3b/MGWUZRBfqvwtwVXmPswkglZh5f8dtwfEciv5zSg/eEO1C9fy+p/HZeDDAZeygvJ5 8wrsWkYbwWP3y+vleb+618nfwGsn4m9b+rRnupgpFI24md4EbhrH9vhtoPdgdI6zcy5R 6bzQ== X-Gm-Message-State: ACrzQf1C/pM37vdA4k+cDDrB2cSkJBomKEs7V4v5Vy5qXRgslietHk4j FvZuQGA8eU4Hr9CD08nOkbvPBzdLs+T5Bg== X-Google-Smtp-Source: AMsMyM46UGP9Sk6pDp0Hz5DmdlMHmh5F/Og+wnp6FLXLayUYDEKhD+Q+cwgiI1V288ZvujJuhvTTbA== X-Received: by 2002:a1c:283:0:b0:3c6:c025:3f3b with SMTP id 125-20020a1c0283000000b003c6c0253f3bmr24379373wmc.101.1666170080474; Wed, 19 Oct 2022 02:01:20 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id r9-20020a05600c458900b003b47b913901sm1017595wmo.1.2022.10.19.02.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 02:01:19 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 19 Oct 2022 10:01:04 +0100 Message-Id: <20221019090107.19975-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221019090107.19975-1-naush@raspberrypi.com> References: <20221019090107.19975-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 Reviewed-by: Kieran Bingham --- 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) {