summaryrefslogtreecommitdiff
path: root/src/libcamera/delayed_controls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/delayed_controls.cpp')
-rw-r--r--src/libcamera/delayed_controls.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index 9667187e..777441e8 100644
--- a/src/libcamera/delayed_controls.cpp
+++ b/src/libcamera/delayed_controls.cpp
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
- * Copyright (C) 2020, Raspberry Pi (Trading) Ltd.
+ * Copyright (C) 2020, Raspberry Pi Ltd
*
* delayed_controls.h - Helper to deal with controls that take effect with a delay
*/
@@ -115,8 +115,6 @@ DelayedControls::DelayedControls(V4L2Device *device,
*/
void DelayedControls::reset()
{
- running_ = false;
- firstSequence_ = 0;
queueCount_ = 1;
writeCount_ = 0;
@@ -204,8 +202,7 @@ bool DelayedControls::push(const ControlList &controls)
*/
ControlList DelayedControls::get(uint32_t sequence)
{
- uint32_t adjustedSeq = sequence - firstSequence_;
- unsigned int index = std::max<int>(0, adjustedSeq - maxDelay_);
+ unsigned int index = std::max<int>(0, sequence - maxDelay_);
ControlList out(device_->controls());
for (const auto &ctrl : values_) {
@@ -236,11 +233,6 @@ void DelayedControls::applyControls(uint32_t sequence)
{
LOG(DelayedControls, Debug) << "frame " << sequence << " started";
- if (!running_) {
- firstSequence_ = sequence;
- running_ = true;
- }
-
/*
* Create control list peeking ahead in the value queue to ensure
* values are set in time to satisfy the sensor delay.
@@ -279,7 +271,7 @@ void DelayedControls::applyControls(uint32_t sequence)
}
}
- writeCount_ = sequence - firstSequence_ + 1;
+ writeCount_ = sequence + 1;
while (writeCount_ > queueCount_) {
LOG(DelayedControls, Debug)