mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-12 23:09:45 +03:00
ipa: rpi: Fix bug in AfState reporting
A previous change introduced a bug in which it reported AfStateIdle
when idle in Auto mode, when it should continue to report the most
recent AF cycle's outcome (AfStateFocused or AfStateFailed).
Also fix the Pause method so it won't reset state to AfStateIdle
when paused in Continuous AF mode (to match documented behaviour).
Fixes: ea5f451c56
("ipa: rpi: controller: AutoFocus bidirectional scanning")
Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
525325440b
commit
e6fb24ffdb
1 changed files with 7 additions and 5 deletions
|
@ -810,10 +810,10 @@ void Af::prepare(Metadata *imageMetadata)
|
||||||
else
|
else
|
||||||
status.pauseState = AfPauseState::Running;
|
status.pauseState = AfPauseState::Running;
|
||||||
|
|
||||||
if (scanState_ == ScanState::Idle)
|
if (mode_ == AfModeAuto && scanState_ != ScanState::Idle)
|
||||||
status.state = AfState::Idle;
|
|
||||||
else if (mode_ == AfModeAuto)
|
|
||||||
status.state = AfState::Scanning;
|
status.state = AfState::Scanning;
|
||||||
|
else if (mode_ == AfModeManual)
|
||||||
|
status.state = AfState::Idle;
|
||||||
else
|
else
|
||||||
status.state = reportState_;
|
status.state = reportState_;
|
||||||
status.lensSetting = initted_ ? std::optional<int>(cfg_.map.eval(fsmooth_))
|
status.lensSetting = initted_ ? std::optional<int>(cfg_.map.eval(fsmooth_))
|
||||||
|
@ -954,8 +954,10 @@ void Af::pause(AfAlgorithm::AfPause pause)
|
||||||
scanState_ = ScanState::Trigger;
|
scanState_ = ScanState::Trigger;
|
||||||
} else if (pause != AfPauseResume && !pauseFlag_) {
|
} else if (pause != AfPauseResume && !pauseFlag_) {
|
||||||
pauseFlag_ = true;
|
pauseFlag_ = true;
|
||||||
if (pause == AfPauseImmediate || scanState_ < ScanState::Coarse1)
|
if (pause == AfPauseImmediate || scanState_ < ScanState::Coarse1) {
|
||||||
goIdle();
|
scanState_ = ScanState::Idle;
|
||||||
|
scanData_.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue