libcamera: ipa: raspberrypi: Recalculate camera exposure/gain when camera mode changes
This commit causes the AGC to recalculate its camera exposure/gain values when the camera mode changes. For example it's possible that the exposure profile could be changed by the application so the division between exposure time and analogue gain may be different. The other underlying reason (and which this commit accomplishes too) is that the sensor's line timing may change in a new mode, and because V4L2 drivers store a number of exposure _lines_, the resulting _time_ will "change under our feet". So we have to go through the process of recalculating the correct number of lines and writing this back to the sensor with every mode switch, regardless of anything else. Signed-off-by: David Plowman <david.plowman@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
ff291b3c15
commit
846e7d999a
3 changed files with 26 additions and 12 deletions
|
@ -221,6 +221,18 @@ void Agc::SetConstraintMode(std::string const &constraint_mode_name)
|
|||
constraint_mode_name_ = constraint_mode_name;
|
||||
}
|
||||
|
||||
void Agc::SwitchMode(CameraMode const &camera_mode, Metadata *metadata)
|
||||
{
|
||||
// On a mode switch, it's possible the exposure profile could change,
|
||||
// so we run through the dividing up of exposure/gain again and
|
||||
// write the results into the metadata we've been given.
|
||||
if (status_.total_exposure_value) {
|
||||
housekeepConfig();
|
||||
divvyupExposure();
|
||||
writeAndFinish(metadata, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Agc::Prepare(Metadata *image_metadata)
|
||||
{
|
||||
AgcStatus status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue