libcamera: src: ipa: raspberrypi: agc: Fix uninitialised members in Agc constructor
Use memset in the constructor for embedded structures, it is tidier and initialises everything. We use the initialiser list for other members. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
2fb5b298da
commit
393f05a9a8
1 changed files with 8 additions and 9 deletions
|
@ -153,16 +153,15 @@ void AgcConfig::Read(boost::property_tree::ptree const ¶ms)
|
||||||
Agc::Agc(Controller *controller)
|
Agc::Agc(Controller *controller)
|
||||||
: AgcAlgorithm(controller), metering_mode_(nullptr),
|
: AgcAlgorithm(controller), metering_mode_(nullptr),
|
||||||
exposure_mode_(nullptr), constraint_mode_(nullptr),
|
exposure_mode_(nullptr), constraint_mode_(nullptr),
|
||||||
frame_count_(0), lock_count_(0)
|
frame_count_(0), lock_count_(0),
|
||||||
|
ev_(1.0), flicker_period_(0.0),
|
||||||
|
fixed_shutter_(0), fixed_analogue_gain_(0.0)
|
||||||
{
|
{
|
||||||
ev_ = status_.ev = 1.0;
|
memset(&awb_, 0, sizeof(awb_));
|
||||||
flicker_period_ = status_.flicker_period = 0.0;
|
// Setting status_.total_exposure_value_ to zero initially tells us
|
||||||
fixed_shutter_ = status_.fixed_shutter = 0;
|
// it's not been calculated yet (i.e. Process hasn't yet run).
|
||||||
fixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0;
|
memset(&status_, 0, sizeof(status_));
|
||||||
// set to zero initially, so we can tell it's not been calculated
|
status_.ev = ev_;
|
||||||
status_.total_exposure_value = 0.0;
|
|
||||||
status_.target_exposure_value = 0.0;
|
|
||||||
status_.locked = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char const *Agc::Name() const
|
char const *Agc::Name() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue