{"id":17737,"url":"https://patchwork.libcamera.org/api/1.1/patches/17737/?format=json","web_url":"https://patchwork.libcamera.org/patch/17737/","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-3-naush@raspberrypi.com>","date":"2022-10-31T11:45:17","name":"[libcamera-devel,v5,2/7] delayed_controls: Add user cookie to DelayedControls","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"4a0ee61c84536bed65232d7d4503d5bda386b89d","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/17737/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/17737/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17737/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 348B2BDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 31 Oct 2022 11:45:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C5B9763047;\n\tMon, 31 Oct 2022 12:45:33 +0100 (CET)","from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 13EEE6303C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Oct 2022 12:45:30 +0100 (CET)","by mail-wm1-x333.google.com with SMTP id\n\tl16-20020a05600c4f1000b003c6c0d2a445so7829417wmq.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 31 Oct 2022 04:45:29 -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.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 31 Oct 2022 04:45:28 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1667216733;\n\tbh=3OkQGGuHDaXKnQLqJ7ahIMxqVij/7kQdZAl0mQRualY=;\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=G2/4IS9n3ZQyQEEiak/qTJr/xKAOXIfPH4ZAbSGF4leSj2RWVc3sDVTHaHn3Q49PE\n\tzwppSnAOmbt2cI+3J6oktFGl5Ha/0lZe5hWXAs2Llp7fjsVRlzbydVAVgtYPRuy/kY\n\tVX07hDWbhDb4iBs7fink7KXTa+fKw/yFyfB9gPmw25vpKtkxQV0in28BFStV6NIbaG\n\t40eNJ+3TZtJQKf6busZnGrh29ocY88TueCzvFT8xqok7Uc028Mkt6dsOvKLKFzi+IY\n\tc0Rar9cPcWCmlzt01ghY/S07OWMG82dHQicAOut5r6BSOk0cUw5TPUWWnbVfgeHvwW\n\taafeiFI3vkV1A==","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=19O3ykJgy/boyGdyqfUfUKxSJwPQG6EIUI1ltOgJCc4=;\n\tb=D6pFidVEA+b3+qjLrOSnPP/jTE5yVYVqPtKfx3WVmL5dZ6NBKFxkKh4Kh8YFJteVCs\n\tRVCCdvOq4vGBiX21SzA8FMd8BjMlnhqaY/KcNCyasswgVgZzX+KKtHcOXAFXsshZ06wN\n\tP6fW7j3HedxmjbbVhzqHT7Fl0YiKovPiQ1wC9+ZLRwOv61uxooOxfy//AJiul6EEL8tE\n\t6cPTv7e0JiEOoC1oEW3X/NOtAq+k6cJMzHo0g3PRDHXI3fdpw6a4hYqinHSV6VihN+0S\n\tqeudl3FpQbPZTkLUUApVJTkJIncq2X7DwViFrIrlxby6QNG2lcuz1JfcJKnlbtmdKAlM\n\tm3kA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"D6pFidVE\"; 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=19O3ykJgy/boyGdyqfUfUKxSJwPQG6EIUI1ltOgJCc4=;\n\tb=Mth0AMVS+n8Htet6SSlYNcAiYIPeOAR+xNsI/4rrAe2le6Ltk0leM9REZV4pUN1IhF\n\tiJjrpy0vTCBeFLNHk54Mmy+hFeKCYf4eSRHICONz3JYFk+IxWKw4bdchtwwmmz5MKhg2\n\tjbh6Rke+ctA7XtDLhCbHolvdDjxgaduhkN24wrDIdfEicHu4YcOB4qpRrKdw27+UFhu4\n\tSvOhn9xuBn62g0aYCJSZSEZlspCIo83l7i6BTkOyTomaQY0EdPoQ37c26LKBknPnyKUy\n\tDCH+WaHfGrCV8huzp3r9dfThlEZbL00Kk11+YQB1TwHXjElwcsxATUuRnSOLU8lU73fd\n\tw8xw==","X-Gm-Message-State":"ACrzQf3n6VovA1dgTVDQBfNke0X0gKUjgwyzp3x7QZ22i9SROMQnCKGv\n\tU1Rk/sTS9jBxSWj1vCEDr+cJqER5PK7q6Q==","X-Google-Smtp-Source":"AMsMyM4Go6ZeYV2BLR3MGXOEMynTKcC7jiI3J+h4V+1BJOLyQysHmy6G4yXGF+8DS2Vy7dgzn0+SWQ==","X-Received":"by 2002:a05:600c:a4b:b0:3b9:859d:7ed6 with SMTP id\n\tc11-20020a05600c0a4b00b003b9859d7ed6mr17964247wmq.169.1667216729061; \n\tMon, 31 Oct 2022 04:45:29 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 31 Oct 2022 11:45:17 +0000","Message-Id":"<20221031114522.14215-3-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 2/7] delayed_controls: Add user cookie\n\tto DelayedControls","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":"Allow the caller to provide a cookie value to DelayedControls::reset and\nDelayedControls::push. This cookie value is returned from DelayedControls::get\nfor the frame that has the control values applied to it.\n\nThe cookie value is useful in tracking when a set of controls has been applied\nto a frame. In a subsequent commit, it will be used by the Raspberry Pi IPA to\ntrack the IPA context used when setting the control values.\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 |  8 ++++---\n src/libcamera/delayed_controls.cpp            | 22 ++++++++++-------\n src/libcamera/pipeline/ipu3/ipu3.cpp          |  9 +++----\n .../pipeline/raspberrypi/raspberrypi.cpp      |  6 ++---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  7 +++---\n test/delayed_controls.cpp                     | 24 +++++++++----------\n 6 files changed, 43 insertions(+), 33 deletions(-)","diff":"diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h\nindex de8026e3e4f0..14470f3966ac 100644\n--- a/include/libcamera/internal/delayed_controls.h\n+++ b/include/libcamera/internal/delayed_controls.h\n@@ -9,6 +9,7 @@\n \n #include <stdint.h>\n #include <unordered_map>\n+#include <utility>\n \n #include <libcamera/controls.h>\n \n@@ -27,10 +28,10 @@ public:\n \tDelayedControls(V4L2Device *device,\n \t\t\tconst std::unordered_map<uint32_t, ControlParams> &controlParams);\n \n-\tvoid reset();\n+\tvoid reset(unsigned int cookie);\n \n-\tbool push(const ControlList &controls);\n-\tControlList get(uint32_t sequence);\n+\tbool push(const ControlList &controls, unsigned int cookie);\n+\tstd::pair<ControlList, unsigned int> get(uint32_t sequence);\n \n \tvoid applyControls(uint32_t sequence);\n \n@@ -77,6 +78,7 @@ private:\n \tuint32_t writeCount_;\n \t/* \\todo Evaluate if we should index on ControlId * or unsigned int */\n \tstd::unordered_map<const ControlId *, RingBuffer<Info>> values_;\n+\tRingBuffer<unsigned int> cookies_;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex 777441e8222a..26243dc9e939 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -104,19 +104,21 @@ DelayedControls::DelayedControls(V4L2Device *device,\n \t\tmaxDelay_ = std::max(maxDelay_, controlParams_[id].delay);\n \t}\n \n-\treset();\n+\treset(0);\n }\n \n /**\n  * \\brief Reset state machine\n+ * \\param[in] cookie User supplied reset cookie value\n  *\n  * Resets the state machine to a starting position based on control values\n  * retrieved from the device.\n  */\n-void DelayedControls::reset()\n+void DelayedControls::reset(unsigned int cookie)\n {\n \tqueueCount_ = 1;\n \twriteCount_ = 0;\n+\tcookies_[0] = cookie;\n \n \t/* Retrieve control as reported by the device. */\n \tstd::vector<uint32_t> ids;\n@@ -140,13 +142,15 @@ void DelayedControls::reset()\n /**\n  * \\brief Push a set of controls on the queue\n  * \\param[in] controls List of controls to add to the device queue\n+ * \\param[in] cookie User supplied cookie value for \\a controls\n  *\n  * Push a set of controls to the control queue. This increases the control queue\n- * depth by one.\n+ * depth by one. The \\a cookie value will be subsequently returned from\n+ * \\a get() for the frame with all controls applied.\n  *\n  * \\returns true if \\a controls are accepted, or false otherwise\n  */\n-bool DelayedControls::push(const ControlList &controls)\n+bool DelayedControls::push(const ControlList &controls, const unsigned int cookie)\n {\n \t/* Copy state from previous frame. */\n \tfor (auto &ctrl : values_) {\n@@ -180,6 +184,7 @@ bool DelayedControls::push(const ControlList &controls)\n \t\t\t<< \" at index \" << queueCount_;\n \t}\n \n+\tcookies_[queueCount_] = cookie;\n \tqueueCount_++;\n \n \treturn true;\n@@ -198,9 +203,10 @@ bool DelayedControls::push(const ControlList &controls)\n  * push(). The max history from the current sequence number that yields valid\n  * values are thus 16 minus number of controls pushed.\n  *\n- * \\return The controls at \\a sequence number\n+ * \\return The controls at \\a sequence number and associated user supplied\n+ * cookie value.\n  */\n-ControlList DelayedControls::get(uint32_t sequence)\n+std::pair<ControlList, unsigned int> DelayedControls::get(uint32_t sequence)\n {\n \tunsigned int index = std::max<int>(0, sequence - maxDelay_);\n \n@@ -217,7 +223,7 @@ ControlList DelayedControls::get(uint32_t sequence)\n \t\t\t<< \" at index \" << index;\n \t}\n \n-\treturn out;\n+\treturn { out, cookies_[index] };\n }\n \n /**\n@@ -276,7 +282,7 @@ void DelayedControls::applyControls(uint32_t sequence)\n \twhile (writeCount_ > queueCount_) {\n \t\tLOG(DelayedControls, Debug)\n \t\t\t<< \"Queue is empty, auto queue no-op.\";\n-\t\tpush({});\n+\t\tpush({}, cookies_[queueCount_ - 1]);\n \t}\n \n \tdevice_->setControls(&out);\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 3b892d9671c5..8a5de76aa1b8 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -789,7 +789,7 @@ int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis\n \tif (ret)\n \t\tgoto error;\n \n-\tdata->delayedCtrls_->reset();\n+\tdata->delayedCtrls_->reset(0);\n \n \t/*\n \t * Start the ImgU video devices, buffers will be queued to the\n@@ -1265,11 +1265,11 @@ int IPU3CameraData::loadIPA()\n \treturn 0;\n }\n \n-void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id,\n+void IPU3CameraData::setSensorControls(unsigned int id,\n \t\t\t\t       const ControlList &sensorControls,\n \t\t\t\t       const ControlList &lensControls)\n {\n-\tdelayedCtrls_->push(sensorControls);\n+\tdelayedCtrls_->push(sensorControls, id);\n \n \tCameraLens *focusLens = cio2_.sensor()->focusLens();\n \tif (!focusLens)\n@@ -1389,7 +1389,8 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer)\n \trequest->metadata().set(controls::SensorTimestamp,\n \t\t\t\tbuffer->metadata().timestamp);\n \n-\tinfo->effectiveSensorControls = delayedCtrls_->get(buffer->metadata().sequence);\n+\tauto [controls, cookie] = delayedCtrls_->get(buffer->metadata().sequence);\n+\tinfo->effectiveSensorControls = std::move(controls);\n \n \tif (request->findBuffer(&rawStream_))\n \t\tpipe()->completeBuffer(request, buffer);\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 343f8cb2c7ed..29626c0ef14e 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1064,7 +1064,7 @@ int PipelineHandlerRPi::start(Camera *camera, const ControlList *controls)\n \t * Reset the delayed controls with the gain and exposure values set by\n \t * the IPA.\n \t */\n-\tdata->delayedCtrls_->reset();\n+\tdata->delayedCtrls_->reset(0);\n \n \tdata->state_ = RPiCameraData::State::Idle;\n \n@@ -1794,7 +1794,7 @@ void RPiCameraData::setIspControls(const ControlList &controls)\n \n void RPiCameraData::setDelayedControls(const ControlList &controls)\n {\n-\tif (!delayedCtrls_->push(controls))\n+\tif (!delayedCtrls_->push(controls, 0))\n \t\tLOG(RPI, Error) << \"V4L2 DelayedControl set failed\";\n \thandleState();\n }\n@@ -1867,7 +1867,7 @@ void RPiCameraData::unicamBufferDequeue(FrameBuffer *buffer)\n \t\t * Lookup the sensor controls used for this frame sequence from\n \t\t * DelayedControl and queue them along with the frame buffer.\n \t\t */\n-\t\tControlList ctrl = delayedCtrls_->get(buffer->metadata().sequence);\n+\t\tauto [ctrl, cookie] = delayedCtrls_->get(buffer->metadata().sequence);\n \t\t/*\n \t\t * Add the frame timestamp to the ControlList for the IPA to use\n \t\t * as it does not receive the FrameBuffer object.\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 455ee2a0a711..6f3c34e764fd 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -376,10 +376,10 @@ void RkISP1CameraData::paramFilled(unsigned int frame)\n \t\tselfPath_->queueBuffer(info->selfPathBuffer);\n }\n \n-void RkISP1CameraData::setSensorControls([[maybe_unused]] unsigned int frame,\n+void RkISP1CameraData::setSensorControls(unsigned int frame,\n \t\t\t\t\t const ControlList &sensorControls)\n {\n-\tdelayedCtrls_->push(sensorControls);\n+\tdelayedCtrls_->push(sensorControls, frame);\n }\n \n void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata)\n@@ -1191,8 +1191,9 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)\n \tif (data->frame_ <= buffer->metadata().sequence)\n \t\tdata->frame_ = buffer->metadata().sequence + 1;\n \n+\tauto [controls, cookie] = data->delayedCtrls_->get(buffer->metadata().sequence);\n \tdata->ipa_->processStatsBuffer(info->frame, info->statBuffer->cookie(),\n-\t\t\t\t       data->delayedCtrls_->get(buffer->metadata().sequence));\n+\t\t\t\t       controls);\n }\n \n REGISTER_PIPELINE_HANDLER(PipelineHandlerRkISP1)\ndiff --git a/test/delayed_controls.cpp b/test/delayed_controls.cpp\nindex a8ce9828d73d..26037268f245 100644\n--- a/test/delayed_controls.cpp\n+++ b/test/delayed_controls.cpp\n@@ -82,7 +82,7 @@ protected:\n \t\t/* Reset control to value not used in test. */\n \t\tctrls.set(V4L2_CID_BRIGHTNESS, 1);\n \t\tdev_->setControls(&ctrls);\n-\t\tdelayed->reset();\n+\t\tdelayed->reset(0);\n \n \t\t/* Trigger the first frame start event */\n \t\tdelayed->applyControls(0);\n@@ -92,11 +92,11 @@ protected:\n \t\t\tint32_t value = 100 + i;\n \n \t\t\tctrls.set(V4L2_CID_BRIGHTNESS, value);\n-\t\t\tdelayed->push(ctrls);\n+\t\t\tdelayed->push(ctrls, i);\n \n \t\t\tdelayed->applyControls(i);\n \n-\t\t\tControlList result = delayed->get(i);\n+\t\t\tauto [result, cookie] = delayed->get(i);\n \t\t\tint32_t brightness = result.get(V4L2_CID_BRIGHTNESS).get<int32_t>();\n \t\t\tif (brightness != value) {\n \t\t\t\tcerr << \"Failed single control without delay\"\n@@ -124,7 +124,7 @@ protected:\n \t\tint32_t expected = 4;\n \t\tctrls.set(V4L2_CID_BRIGHTNESS, expected);\n \t\tdev_->setControls(&ctrls);\n-\t\tdelayed->reset();\n+\t\tdelayed->reset(0);\n \n \t\t/* Trigger the first frame start event */\n \t\tdelayed->applyControls(0);\n@@ -134,11 +134,11 @@ protected:\n \t\t\tint32_t value = 10 + i;\n \n \t\t\tctrls.set(V4L2_CID_BRIGHTNESS, value);\n-\t\t\tdelayed->push(ctrls);\n+\t\t\tdelayed->push(ctrls, i);\n \n \t\t\tdelayed->applyControls(i);\n \n-\t\t\tControlList result = delayed->get(i);\n+\t\t\tauto [result, cookie] = delayed->get(i);\n \t\t\tint32_t brightness = result.get(V4L2_CID_BRIGHTNESS).get<int32_t>();\n \t\t\tif (brightness != expected) {\n \t\t\t\tcerr << \"Failed single control with delay\"\n@@ -172,7 +172,7 @@ protected:\n \t\tctrls.set(V4L2_CID_BRIGHTNESS, expected);\n \t\tctrls.set(V4L2_CID_CONTRAST, expected + 1);\n \t\tdev_->setControls(&ctrls);\n-\t\tdelayed->reset();\n+\t\tdelayed->reset(0);\n \n \t\t/* Trigger the first frame start event */\n \t\tdelayed->applyControls(0);\n@@ -183,11 +183,11 @@ protected:\n \n \t\t\tctrls.set(V4L2_CID_BRIGHTNESS, value);\n \t\t\tctrls.set(V4L2_CID_CONTRAST, value + 1);\n-\t\t\tdelayed->push(ctrls);\n+\t\t\tdelayed->push(ctrls, i);\n \n \t\t\tdelayed->applyControls(i);\n \n-\t\t\tControlList result = delayed->get(i);\n+\t\t\tauto [result, cookie] = delayed->get(i);\n \t\t\tint32_t brightness = result.get(V4L2_CID_BRIGHTNESS).get<int32_t>();\n \t\t\tint32_t contrast = result.get(V4L2_CID_CONTRAST).get<int32_t>();\n \t\t\tif (brightness != expected || contrast != expected + 1) {\n@@ -223,7 +223,7 @@ protected:\n \t\tctrls.set(V4L2_CID_BRIGHTNESS, expected);\n \t\tctrls.set(V4L2_CID_CONTRAST, expected);\n \t\tdev_->setControls(&ctrls);\n-\t\tdelayed->reset();\n+\t\tdelayed->reset(0);\n \n \t\t/* Trigger the first frame start event */\n \t\tdelayed->applyControls(0);\n@@ -238,7 +238,7 @@ protected:\n \n \t\t\tctrls.set(V4L2_CID_BRIGHTNESS, value);\n \t\t\tctrls.set(V4L2_CID_CONTRAST, value);\n-\t\t\tdelayed->push(ctrls);\n+\t\t\tdelayed->push(ctrls, i);\n \t\t}\n \n \t\t/* Process all queued controls. */\n@@ -247,7 +247,7 @@ protected:\n \n \t\t\tdelayed->applyControls(i);\n \n-\t\t\tControlList result = delayed->get(i);\n+\t\t\tauto [result, cookie] = delayed->get(i);\n \n \t\t\tint32_t brightness = result.get(V4L2_CID_BRIGHTNESS).get<int32_t>();\n \t\t\tint32_t contrast = result.get(V4L2_CID_CONTRAST).get<int32_t>();\n","prefixes":["libcamera-devel","v5","2/7"]}