summaryrefslogtreecommitdiff
path: root/src/libcamera/delayed_controls.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-03-04 08:17:26 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-03-12 14:12:55 +0000
commita940866440202bddf14d1c69c8657a6d099f1ea0 (patch)
tree821eb75bcbb1a151be795bcdd58e1ccfa937e021 /src/libcamera/delayed_controls.cpp
parent47e27ee93bcfb70288e2ee1cd81153d416307b47 (diff)
libcamera: delayed_controls: Fix off-by-one error in get()
There was an off-by-one error in DelayedControls::get() when picking controls from the queue to return back to the pipeline handler. This is only noticeable as small oscillations in brightness when closely viewing frame while AGC is running. The old StaggeredCtrl did not show this error as the startup queuing mechanism has changed in DelayedControls. Fix this by indexing to the correct position in the queue. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reported-by: David Plowman <david.plowman@raspberrypi.com> Fixes: 3d4b7b005911 ("libcamera: delayed_controls: Add helper for controls that apply with a delay") Tested-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/delayed_controls.cpp')
-rw-r--r--src/libcamera/delayed_controls.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index 2f953a06..a3917fd9 100644
--- a/src/libcamera/delayed_controls.cpp
+++ b/src/libcamera/delayed_controls.cpp
@@ -184,7 +184,7 @@ bool DelayedControls::push(const ControlList &controls)
*/
ControlList DelayedControls::get(uint32_t sequence)
{
- uint32_t adjustedSeq = sequence - firstSequence_ + 1;
+ uint32_t adjustedSeq = sequence - firstSequence_;
unsigned int index = std::max<int>(0, adjustedSeq - maxDelay_);
ControlList out(device_->controls());