src: ipa: raspberrypi: agc: Make AGC handle Pause/Resume for itself
AGC, when paused, sets the last exposure/gain it wrote to be its "fixed" values and will therefore continue to return them. When resumed, we clear them so that both will float again. This approach is better because AGC can be paused and we can subsequently change (for example) the exposure and the gain won't float again. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@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
1b5001e92f
commit
4db11b5725
2 changed files with 28 additions and 0 deletions
|
@ -184,6 +184,26 @@ void Agc::Read(boost::property_tree::ptree const ¶ms)
|
|||
exposure_mode_ = &config_.exposure_modes[exposure_mode_name_];
|
||||
constraint_mode_name_ = config_.default_constraint_mode;
|
||||
constraint_mode_ = &config_.constraint_modes[constraint_mode_name_];
|
||||
// Set up the "last shutter/gain" values, in case AGC starts "disabled".
|
||||
status_.shutter_time = config_.default_exposure_time;
|
||||
status_.analogue_gain = config_.default_analogue_gain;
|
||||
}
|
||||
|
||||
bool Agc::IsPaused() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Agc::Pause()
|
||||
{
|
||||
fixed_shutter_ = status_.shutter_time;
|
||||
fixed_analogue_gain_ = status_.analogue_gain;
|
||||
}
|
||||
|
||||
void Agc::Resume()
|
||||
{
|
||||
fixed_shutter_ = 0;
|
||||
fixed_analogue_gain_ = 0;
|
||||
}
|
||||
|
||||
void Agc::SetEv(double ev)
|
||||
|
@ -199,11 +219,15 @@ void Agc::SetFlickerPeriod(double flicker_period)
|
|||
void Agc::SetFixedShutter(double fixed_shutter)
|
||||
{
|
||||
fixed_shutter_ = fixed_shutter;
|
||||
// Set this in case someone calls Pause() straight after.
|
||||
status_.shutter_time = fixed_shutter;
|
||||
}
|
||||
|
||||
void Agc::SetFixedAnalogueGain(double fixed_analogue_gain)
|
||||
{
|
||||
fixed_analogue_gain_ = fixed_analogue_gain;
|
||||
// Set this in case someone calls Pause() straight after.
|
||||
status_.analogue_gain = fixed_analogue_gain;
|
||||
}
|
||||
|
||||
void Agc::SetMeteringMode(std::string const &metering_mode_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue