{"id":17274,"url":"https://patchwork.libcamera.org/api/1.1/patches/17274/?format=json","web_url":"https://patchwork.libcamera.org/patch/17274/","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":"<20220902120808.842-2-naush@raspberrypi.com>","date":"2022-09-02T12:08:03","name":"[libcamera-devel,v1,1/6] 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/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17274/mbox/","series":[{"id":3459,"url":"https://patchwork.libcamera.org/api/1.1/series/3459/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3459","date":"2022-09-02T12:08:02","name":"Raspberry Pi AGC digial gain fixes","version":1,"mbox":"https://patchwork.libcamera.org/series/3459/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17274/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17274/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 A467CC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Sep 2022 12:08:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6826C61FDF;\n\tFri,  2 Sep 2022 14:08:18 +0200 (CEST)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D62FF603E1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Sep 2022 14:08:16 +0200 (CEST)","by mail-wm1-x32a.google.com with SMTP id k17so1132858wmr.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 02 Sep 2022 05:08:16 -0700 (PDT)","from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th2-20020a5d4302000000b0021e51c039c5sm1397809wrq.80.2022.09.02.05.08.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 02 Sep 2022 05:08:15 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662120498;\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=fWCCFafZMDV1UWnq0PTXMMEdCpKUz6HIuRFOsNAR8ls9Gz45b0HHGbIkayRxfXj13\n\trULVhpp93EjRn0ZQmPUaQorVseQ2mRUSyv2/YQg8kkzFaCgWaNJorcVhQC5og/1+6n\n\t2N7V9cyRcb9Pjjw7/Ad4CzJWTJjSGBtirdJ0XHsamo6ShpzYm1K6do+eXuzoK0gDty\n\t5s0KqCVskrHd3yksck+alb4avHFu9HtLX/JlT/vuRUZ1jwLtWjZW40AdeIkFH4Hhxe\n\ttbs8YTenjZvvSWuEXh5ggiXDYfN3b+mxXgVI3FpE8+cD0XqG3z9EcRHxhyt4ooA8vK\n\t40TiPkmj1sN4w==","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=NILdb5aloWYnTaJCZrGezyD2nxg5OB5WjEW5Rbqrh1qpeHIhHtKQdIO2aXjd1Mp6hx\n\tOZUbp8BIUBZW9+cA7Y/Tu9tJXZlcXCJooJNczXbTjoNC5TtCZVPJ7J6gm3hgZlLDYOos\n\tloNJMAtbll91VV0JZLtZ7/Zn7kvTHwIEBDejSOaE/AbwCuOeAWesZlKgtFmYEiWAy49J\n\tuIf3cC9riGDGBvV+nFMN6//w4MQ+NBKu8p8dbICR/xyEFM8ipWy8CUxUIr4y+jDYNhPY\n\tpykPquEaQh1wQkmGWVW6rpdhPmEkqWpY1WG2YO6pCMsj/K93j5j7SAuyjwRoUpcaWknr\n\ttAzw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"NILdb5al\"; 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=X7gRv8LqzHBmJNqNYjFjno091BiJOEsUCat2GeUL4XOPNNcCcoocb9weltzTj2o7J0\n\tkTAjFW1TxVQiZw8khaDQ51d5VucSfVUCpr+j391bm8k9mnWko4Y93/ARR0SC6Yyl/Z5C\n\txiO254m8IO1yCWDiyy11Gjl+RPyFOYg4/jSK3SgUAHdRbcV6xsij9JQfw76wTpxl5ykH\n\tkphz6M2c4Q3rXNV8l7+bmTpJyfcG+hukU2C7BXsPnu3w49NdJ6ljNoUWssUuEs6v3KLj\n\thZ5pWRoWLM5XfGVGCa5arNVviR2JcPdmsRn7esXTXFuLlSBHylqTy5FH3wo1wC7fLEez\n\tsP4Q==","X-Gm-Message-State":"ACgBeo06cojEOskGw4MyP9888X8ebYpWR5l3N21B7oi64Q4mLY3CY9FT\n\tD0ECQTkaMbEFPLXuWaMD3onTMNLD5f2oFqWU","X-Google-Smtp-Source":"AA6agR7syQlFPTT+++I5hyugMczTA0UncrZSmQ5a5wQu9QL++DgSflU7WqrfX1YWSlo2UFsJHnhCxg==","X-Received":"by 2002:a05:600c:4e8d:b0:3a5:f7ed:873 with SMTP id\n\tf13-20020a05600c4e8d00b003a5f7ed0873mr2703331wmq.170.1662120496217; \n\tFri, 02 Sep 2022 05:08:16 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  2 Sep 2022 13:08:03 +0100","Message-Id":"<20220902120808.842-2-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220902120808.842-1-naush@raspberrypi.com>","References":"<20220902120808.842-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v1 1/6] 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","v1","1/6"]}