{"id":12224,"url":"https://patchwork.libcamera.org/api/1.1/patches/12224/?format=json","web_url":"https://patchwork.libcamera.org/patch/12224/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210507084042.31879-4-naush@raspberrypi.com>","date":"2021-05-07T08:40:40","name":"[libcamera-devel,v6,3/5] ipa: raspberrypi: Add move/copy ctors and operators to Metadata class","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"a809860e1cca3a702145f281e8db1271eede49a5","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12224/mbox/","series":[{"id":2010,"url":"https://patchwork.libcamera.org/api/1.1/series/2010/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2010","date":"2021-05-07T08:40:37","name":"ipa: raspberrypi: Rate-limit the controller algorithms","version":6,"mbox":"https://patchwork.libcamera.org/series/2010/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12224/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12224/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C585DBF835\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  7 May 2021 08:40:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0B4F868922;\n\tFri,  7 May 2021 10:40:53 +0200 (CEST)","from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 530846890C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  7 May 2021 10:40:51 +0200 (CEST)","by mail-wr1-x42f.google.com with SMTP id d11so8307286wrw.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 07 May 2021 01:40:51 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:81ab:95ee:9715:e9fb])\n\tby smtp.gmail.com with ESMTPSA id\n\tl12sm7604098wrm.76.2021.05.07.01.40.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 07 May 2021 01:40:50 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"JoMOA0q+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=xuoCbVuKUIV66V4sgaGGY+s1zJ8EKg0r9sGPnJwPd7c=;\n\tb=JoMOA0q+PdyiE4YVl796UrAGS+2B2MCT6G659h5Y9JQllK7wwu50ZQ5LbBEA1MFUxI\n\tle3qVa72nNCbyn47DrqfuuMEIi+Mxq02ah1yabFJAjyAwAbVbdgW+KTFPNSJ8VyBv9tA\n\tXnnJE7TX/xYlsFtOzOxAMqtL51+m/cv1bLB+AccWyxeFKPlwgeypzLg/VJztHL/a6WQP\n\tNTmCDWOAnh2GrSXoTgTuNjh229oZtqFfk0yT/FMCClBeTf8YKsXtODq5Ppcekyl4U72F\n\tnbHA6FcNMf0S5pdpsQolVr6oH0IP7wwdFIMl4bYV5vUlnskEJ9P71RrBeufT4/Uuksia\n\tHNlA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=xuoCbVuKUIV66V4sgaGGY+s1zJ8EKg0r9sGPnJwPd7c=;\n\tb=D+5LUYZ5epSJ1wDdKCk7DJgK3/DiyMrGrSuvlbUBBQTOf/sEl4iNTdDe6z/xhOZGKP\n\tjOljqRZ3Q0KuAEhtRad468cM6k+nGAoMS9Yd4kSl9wA4RKlLdQO3Lav9yEvknKwovEel\n\tvkGIj95z41Yh6BZYg92BHU6dWob8LsS4NpYmEp0iJRQtm2loExKeHq4Ikz0pg5PkEiIT\n\towXGQLcyIra13236/u5/YJ/YKVHBBLIZn1o3ZcxaDjZ/BsgnxiC6l3XN0tT0T5Knz2K5\n\tIM84NBBM2mKaCAcP70orIG2DoPjJmvw/xasPpoP66U+KvTh7umzXFNmkRlAHp8QvrAHc\n\tWzXg==","X-Gm-Message-State":"AOAM531LtKZSQOIHQq9ZUoo4o/gcrzjS8irMfFy1u3o7NWFM4oSa0Aa9\n\t5+3zYWt51j0OYAhRo+hxXHlrCCstOt71cA==","X-Google-Smtp-Source":"ABdhPJxF7gsr2QgV7o+ADEQAJDXCWQXpHMvJjxaghHunRJnLFYdb8p4KCUM1RjBFkLVPVBnEulJ0XA==","X-Received":"by 2002:adf:d084:: with SMTP id y4mr10946207wrh.0.1620376850628; \n\tFri, 07 May 2021 01:40:50 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  7 May 2021 09:40:40 +0100","Message-Id":"<20210507084042.31879-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210507084042.31879-1-naush@raspberrypi.com>","References":"<20210507084042.31879-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v6 3/5] ipa: raspberrypi: Add move/copy\n\tctors and operators to Metadata class","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a default, move and copy constructor as well as a move operator\nimplementation RPiController::Metadata class.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/metadata.hpp | 24 +++++++++++++++++++++\n 1 file changed, 24 insertions(+)","diff":"diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp\nindex 07dd28ed9e0a..319f2320fc70 100644\n--- a/src/ipa/raspberrypi/controller/metadata.hpp\n+++ b/src/ipa/raspberrypi/controller/metadata.hpp\n@@ -19,6 +19,21 @@ namespace RPiController {\n class Metadata\n {\n public:\n+\tMetadata() = default;\n+\n+\tMetadata(Metadata const &other)\n+\t{\n+\t\tstd::lock_guard<std::mutex> other_lock(other.mutex_);\n+\t\tdata_ = other.data_;\n+\t}\n+\n+\tMetadata(Metadata &&other)\n+\t{\n+\t\tstd::lock_guard<std::mutex> other_lock(other.mutex_);\n+\t\tdata_ = std::move(other.data_);\n+\t\tother.data_.clear();\n+\t}\n+\n \ttemplate<typename T>\n \tvoid Set(std::string const &tag, T const &value)\n \t{\n@@ -51,6 +66,15 @@ public:\n \t\treturn *this;\n \t}\n \n+\tMetadata &operator=(Metadata &&other)\n+\t{\n+\t\tstd::lock_guard<std::mutex> lock(mutex_);\n+\t\tstd::lock_guard<std::mutex> other_lock(other.mutex_);\n+\t\tdata_ = std::move(other.data_);\n+\t\tother.data_.clear();\n+\t\treturn *this;\n+\t}\n+\n \ttemplate<typename T>\n \tT *GetLocked(std::string const &tag)\n \t{\n","prefixes":["libcamera-devel","v6","3/5"]}