ipa: rpi: Set lens position to hyperfocal on startup
On the first ipa->configure() call, set the lens position (if a lens is present) to the default position. Typically this would be the hyperfocal position based on the tuning data. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
d66ff77759
commit
fab47108e1
1 changed files with 20 additions and 0 deletions
|
@ -208,6 +208,26 @@ int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa
|
||||||
agcStatus.shutterTime = defaultExposureTime;
|
agcStatus.shutterTime = defaultExposureTime;
|
||||||
agcStatus.analogueGain = defaultAnalogueGain;
|
agcStatus.analogueGain = defaultAnalogueGain;
|
||||||
applyAGC(&agcStatus, ctrls);
|
applyAGC(&agcStatus, ctrls);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the lens to the default (typically hyperfocal) position
|
||||||
|
* on first start.
|
||||||
|
*/
|
||||||
|
if (lensPresent_) {
|
||||||
|
RPiController::AfAlgorithm *af =
|
||||||
|
dynamic_cast<RPiController::AfAlgorithm *>(controller_.getAlgorithm("af"));
|
||||||
|
|
||||||
|
if (af) {
|
||||||
|
float defaultPos =
|
||||||
|
ipaAfControls.at(&controls::LensPosition).def().get<float>();
|
||||||
|
ControlList lensCtrl(lensCtrls_);
|
||||||
|
int32_t hwpos;
|
||||||
|
|
||||||
|
af->setLensPosition(defaultPos, &hwpos);
|
||||||
|
lensCtrl.set(V4L2_CID_FOCUS_ABSOLUTE, hwpos);
|
||||||
|
result->lensControls = std::move(lensCtrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result->sensorControls = std::move(ctrls);
|
result->sensorControls = std::move(ctrls);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue