{"id":17297,"url":"https://patchwork.libcamera.org/api/patches/17297/?format=json","web_url":"https://patchwork.libcamera.org/patch/17297/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20220905073956.7342-2-naush@raspberrypi.com>","date":"2022-09-05T07:39:50","name":"[libcamera-devel,v2,1/7] delayed_controls: Template the ControlRingBuffer class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"bcc68456fd27de6b598ce22cd27538949bc7cace","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17297/mbox/","series":[{"id":3471,"url":"https://patchwork.libcamera.org/api/series/3471/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3471","date":"2022-09-05T07:39:49","name":"Raspberry Pi AGC digial gain fixes","version":2,"mbox":"https://patchwork.libcamera.org/series/3471/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17297/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17297/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 0118BC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Sep 2022 07:40:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BD25862055;\n\tMon,  5 Sep 2022 09:40:03 +0200 (CEST)","from mail-wr1-x435.google.com (mail-wr1-x435.google.com\n\t[IPv6:2a00:1450:4864:20::435])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7132C6201C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Sep 2022 09:40:02 +0200 (CEST)","by mail-wr1-x435.google.com with SMTP id b5so10129234wrr.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Sep 2022 00:40:02 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tv16-20020a5d5910000000b00228a6ce17b4sm1342841wrd.37.2022.09.05.00.40.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 05 Sep 2022 00:40:00 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662363603;\n\tbh=gBEVAsghRyLUxKvoBP8RRSW7iyAeDStcB1KGpH1JaZU=;\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=J88yF96sIEub2NPucSFvrXEkQ0gJm7SyBJc13ut7QQ3MwMWCWbMqS2T/bedPkOOcw\n\tY6DV/G+8xg2x+w+qiJfYpy56pYpu2Hgi3fHTJQTIqd1f8GRYeBKFxK6aSbCt+w13Do\n\tjUEogmvIp9eZHxSmV5mHJVg1VUs0m8Cj5FySqn5L53lu8SlMCw6dfItZ435NiKUG2N\n\tS07kQkNm02hUcx1khLSNgcuFlkd1+B43gTxbi1qPXdITuXlI2euYdMsbtqr6LqfUg0\n\tbZ4Xs6OaiHShKp7NCBb5ZzEoVb0mDXxLR25z9QCYBGkz3anLFdW+oHcYSGvBQqvs4h\n\tlZYPlIPkgioUw==","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\tbh=YJjap5Vlhvd2qi+OflmsVt8uhRG4R/2mis0V9sewWMk=;\n\tb=RzxeWYATs6sjM/vmO+31Ea/XFnqKmFOpXsEHXj7RnC/iBxhII707W19NOs5R+Wy+E0\n\tXUcM3cHmR8XLMk9yeikOWkVienUav9IEkgG7izLCDJGIyknfPfYMZsTvKl2FxPZknq3g\n\tReziLa//SIf71obNCDHAjKDf5cxnQ3VuHmsrpfx5KFtJskKT+w6ZrVZCECFesgpncyso\n\tu52dEmIR7yjCQOl8IoBlqMOayk3lvlzq991jAFl0VtYfnRXarsKfvisHBKjvLcssxasc\n\tSoQ7v0zPSdnJ/Na3fltVIY+0mfjJbOzwh9mKZVfO2uw1H13S+wJV5JsaznGRM0ACbofp\n\t9X6g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"RzxeWYAT\"; 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;\n\tbh=YJjap5Vlhvd2qi+OflmsVt8uhRG4R/2mis0V9sewWMk=;\n\tb=soLZj4n4uIjMcc1665RDulmq0dcAJinlXurmHxeRyFNuNRAfXfI0DLSkAXjHM3OBXr\n\tSWTYptheDW1n/0PziCvan6IIMNbHnNgnv0Vd2nPsjwF7459QRJdjrTdY2go0bDdNgBVc\n\tvIksbAJ9colCoBIOp6yDGnqGxgIQRkkt2MUwxKGUR+tfZyl5UzUknCCWklONJEKmiTKU\n\tGELf38WBmHLuSuHsdMjap0ZFIEM0evaNQkjqtkn++k/gC9VUdURQRsWL+wZNk9OcG1zw\n\tLQFJUaIgvZAiQR3Cfs9TwfGekadZlZo+AxdqtSg4GnEeJ625tXmNSLPmo74EcDzf9ArX\n\tHIlQ==","X-Gm-Message-State":"ACgBeo2BIjQRJiBWKXLB+zXbAukZA3Tje8FWC9bjcWAH3ui8LESRrq5x\n\t4JU2B0OSsW6dyNvt9Lv6IGtOCTFSoTH6v6PZ","X-Google-Smtp-Source":"AA6agR7V7/MW2dRe3hW7BuI3LhiiDqF6fWsmHnQgxyZZN8251xNSJi1xETsg3mBlZlH7J6uhhVAOHw==","X-Received":"by 2002:a5d:588d:0:b0:225:6e1a:8696 with SMTP id\n\tn13-20020a5d588d000000b002256e1a8696mr23374023wrf.512.1662363601833; \n\tMon, 05 Sep 2022 00:40:01 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  5 Sep 2022 08:39:50 +0100","Message-Id":"<20220905073956.7342-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220905073956.7342-1-naush@raspberrypi.com>","References":"<20220905073956.7342-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 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.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.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..f6e622f1dfba 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 ControlRingBuffer : 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 *, ControlRingBuffer<Info>> values_;\n };\n \n } /* namespace libcamera */\n","prefixes":["libcamera-devel","v2","1/7"]}