{"id":17736,"url":"https://patchwork.libcamera.org/api/1.1/patches/17736/?format=json","web_url":"https://patchwork.libcamera.org/patch/17736/","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":"<20221031114522.14215-2-naush@raspberrypi.com>","date":"2022-10-31T11:45:16","name":"[libcamera-devel,v5,1/7] delayed_controls: Template the ControlRingBuffer class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"bf8843fac7e7dadb891edbfeaf07056d3ae994ad","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/17736/mbox/","series":[{"id":3590,"url":"https://patchwork.libcamera.org/api/1.1/series/3590/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3590","date":"2022-10-31T11:45:15","name":"Raspberry Pi AGC digital gain fixes","version":5,"mbox":"https://patchwork.libcamera.org/series/3590/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17736/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17736/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 D8AE0C3285\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 31 Oct 2022 11:45:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 00D2163035;\n\tMon, 31 Oct 2022 12:45:30 +0100 (CET)","from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com\n\t[IPv6:2a00:1450:4864:20::42d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D7DC961F46\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Oct 2022 12:45:28 +0100 (CET)","by mail-wr1-x42d.google.com with SMTP id bs21so15587813wrb.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Oct 2022 04:45:28 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th11-20020adff18b000000b0023677e1157fsm6936354wro.56.2022.10.31.04.45.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 31 Oct 2022 04:45:27 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1667216730;\n\tbh=94lFACRMLlJSvs2JAH2MVfht2+K/TNuOHg6pDaIUxFM=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=3Sd0O5Jhu82eCrluf2Qp53x7zIZ4KSol9fIfq4TOiPxL+25YCjWiFoTeKLKt2jUkc\n\t5YGgOueyL+FjIAJet9N4rVpURksu1LPCt5O3CUwSDspBVwk14NI/YuBaM8p+Amwimd\n\tLIf/K0i581UPHzHrNbf4szpgZuKke2PsWWjlk+nYXw0YvFT+nKzgdaLzF2doG4XB5h\n\tEYXnCp9ipWOcr+tTAxzqtp86BzDK/YoishQ4czlsJsP89CTRcRGq6gFXf5PhlWeUl/\n\t3KM8xofM69OglsBorndqDnjINyG9SRubWf6yE3H7OvRJ2NybtFONwPqq6LJueaPIjn\n\tUqUoMDIwP5S+A==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=JPw0yACzhH/JPVM8B5gaYJbcuHwNFRb/r1SBK2+U6XM=;\n\tb=Tw0mQnazQMBMMBOaBFgYinlSjDkdVcga9+oy1+cN+GttecdOztgomH9cFn4T2dXOY4\n\ts/3ETiFaJGrbMML+bcl5nvj+y7n+Oa6LsIo/HONfif9pozvIyLjiXlydrGnjyYHuF0RL\n\t14UYTqNpeUR0YQbmG3veSe4pIQLQxhZjXl8sjAAmlXQ2w9J3kr1MTCjm9z2cD6ZiwE9U\n\t7WgWoMOAdmjuFPZEVqtj3ESWErrJ6BwiSlHOCiTPqEvyzGs2QccrWyFI1cR1IRX78DVs\n\tdy7bDO6e2CUKRrmD/vM86xs7zchtTKYLDdqM8h1N1ZP8vpSqDeJxA0aUgDmFh+diAizA\n\tH03g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Tw0mQnaz\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=JPw0yACzhH/JPVM8B5gaYJbcuHwNFRb/r1SBK2+U6XM=;\n\tb=TzxFnHZDFSNQZyhiqmypDkpUv245zQe+nSIc6Z2cJ/y3GF/8Toxc0A4hg+EleQwuMQ\n\t6ubaS5LzBGjlZ1cY1TSXPZX0xXWkGQy7SVvqyYwrO0WlJ5GKwycVJgr1GCYFUcUzvcR1\n\tX79xpkzgagxWZX2DLPoviAqByMwumndMyZ434iTfjcQ52mqLkuR/530HbEM5C4CNMlAM\n\t5KVqCBc14Taqom3u+SK8OsR0LTwmszvXfXeJP3bRTRDLJDmKiJPNN4GYsh+vVjqGfpI+\n\t9U49qUCI5mOZfVc/1kh0gonllyhhSfZ+/S4OL9UC6YIihzeNUi7pFGJn0GMVsaPwu4Ok\n\t6JnQ==","X-Gm-Message-State":"ACrzQf16cRdqZDZAuhpROBExTcPTAurqFRdXV2uVQt0P9na8u/VpwSJN\n\t4WxBD5tLYZVlS/nzJd3iSe/9MzHoF0aLsA==","X-Google-Smtp-Source":"AMsMyM7as4+D+pU6RuqYK9Zx67wS/TgsVR6r1pi8n4c6timO2gzK6BDWiyiwB4OqF/kaFQz5gkafkA==","X-Received":"by 2002:a5d:4410:0:b0:236:a8f9:268f with SMTP id\n\tz16-20020a5d4410000000b00236a8f9268fmr7816879wrq.405.1667216728178; \n\tMon, 31 Oct 2022 04:45:28 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 31 Oct 2022 11:45:16 +0000","Message-Id":"<20221031114522.14215-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20221031114522.14215-1-naush@raspberrypi.com>","References":"<20221031114522.14215-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 1/7] delayed_controls: Template the\n\tControlRingBuffer 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>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Convert ControlRingBuffer to a templated class to allow arbitrary ring buffer\narray types to be defined. Rename ControlRingBuffer to RingBuffer to indicate\nthis.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/internal/delayed_controls.h | 13 +++++++------\n 1 file changed, 7 insertions(+), 6 deletions(-)","diff":"diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h\nindex aef37077103c..de8026e3e4f0 100644\n--- a/include/libcamera/internal/delayed_controls.h\n+++ b/include/libcamera/internal/delayed_controls.h\n@@ -53,17 +53,18 @@ private:\n \n \t/* \\todo Make the listSize configurable at instance creation time. */\n \tstatic constexpr int listSize = 16;\n-\tclass ControlRingBuffer : public std::array<Info, listSize>\n+\ttemplate<typename T>\n+\tclass RingBuffer : public std::array<T, listSize>\n \t{\n \tpublic:\n-\t\tInfo &operator[](unsigned int index)\n+\t\tT &operator[](unsigned int index)\n \t\t{\n-\t\t\treturn std::array<Info, listSize>::operator[](index % listSize);\n+\t\t\treturn std::array<T, listSize>::operator[](index % listSize);\n \t\t}\n \n-\t\tconst Info &operator[](unsigned int index) const\n+\t\tconst T &operator[](unsigned int index) const\n \t\t{\n-\t\t\treturn std::array<Info, listSize>::operator[](index % listSize);\n+\t\t\treturn std::array<T, listSize>::operator[](index % listSize);\n \t\t}\n \t};\n \n@@ -75,7 +76,7 @@ private:\n \tuint32_t queueCount_;\n \tuint32_t writeCount_;\n \t/* \\todo Evaluate if we should index on ControlId * or unsigned int */\n-\tstd::unordered_map<const ControlId *, ControlRingBuffer> values_;\n+\tstd::unordered_map<const ControlId *, RingBuffer<Info>> values_;\n };\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","v5","1/7"]}