ipa: raspberrypi: Add minimum and maximum line length fields to CameraMode
Add fields for minimum and maximum line length duration to the CameraMode structure. This replaces the existing lineLength field. Any use of the existing lineLength field is replaced by the new minLineLength field, as logically we always want to use the fastest sensor readout by default. As a drive-by cosmetic change, split all fields in the CameraMode structure into separate lines. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
e5fc0132f8
commit
c513522f3f
3 changed files with 27 additions and 19 deletions
|
@ -314,7 +314,7 @@ void IPARPi::start(const ControlList &controls, StartConfig *startConfig)
|
|||
}
|
||||
|
||||
startConfig->dropFrameCount = dropFrameCount_;
|
||||
const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;
|
||||
const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.minLineLength;
|
||||
startConfig->maxSensorFrameLengthMs = maxSensorFrameDuration.get<std::milli>();
|
||||
|
||||
firstStart_ = false;
|
||||
|
@ -356,7 +356,8 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)
|
|||
* Calculate the line length as the ratio between the line length in
|
||||
* pixels and the pixel rate.
|
||||
*/
|
||||
mode_.lineLength = sensorInfo.minLineLength * (1.0s / sensorInfo.pixelRate);
|
||||
mode_.minLineLength = sensorInfo.minLineLength * (1.0s / sensorInfo.pixelRate);
|
||||
mode_.maxLineLength = sensorInfo.maxLineLength * (1.0s / sensorInfo.pixelRate);
|
||||
|
||||
/*
|
||||
* Set the frame length limits for the mode to ensure exposure and
|
||||
|
@ -458,8 +459,8 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,
|
|||
* based on the current sensor mode.
|
||||
*/
|
||||
ControlInfoMap::Map ctrlMap = ipaControls;
|
||||
const Duration minSensorFrameDuration = mode_.minFrameLength * mode_.lineLength;
|
||||
const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;
|
||||
const Duration minSensorFrameDuration = mode_.minFrameLength * mode_.minLineLength;
|
||||
const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.minLineLength;
|
||||
ctrlMap[&controls::FrameDurationLimits] =
|
||||
ControlInfo(static_cast<int64_t>(minSensorFrameDuration.get<std::micro>()),
|
||||
static_cast<int64_t>(maxSensorFrameDuration.get<std::micro>()));
|
||||
|
@ -1149,8 +1150,8 @@ void IPARPi::applyAWB(const struct AwbStatus *awbStatus, ControlList &ctrls)
|
|||
|
||||
void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDuration)
|
||||
{
|
||||
const Duration minSensorFrameDuration = mode_.minFrameLength * mode_.lineLength;
|
||||
const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength;
|
||||
const Duration minSensorFrameDuration = mode_.minFrameLength * mode_.minLineLength;
|
||||
const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.minLineLength;
|
||||
|
||||
/*
|
||||
* This will only be applied once AGC recalculations occur.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue