From b876c64613293bdf7735f761bf3281ec2a55a3bb Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 23 Mar 2021 14:36:09 +0000 Subject: ipa: raspberrypi: Rationalise parameters to ipa::start() Separate out the in and out parameters in ipa::start() as they are not the same. This function now takes in a ControlList and returns out a struct StartConfig which holds a ControlList and drop frame count for the pipeline handler to action. Signed-off-by: Naushir Patuck Tested-by: David Plowman Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/raspberrypi.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/ipa') diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 93e43f06..b717a83e 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -79,8 +79,7 @@ public: } int init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConfig) override; - void start(const ipa::RPi::StartControls &data, - ipa::RPi::StartControls *result) override; + void start(const ControlList &controls, ipa::RPi::StartConfig *startConfig) override; void stop() override {} int configure(const CameraSensorInfo &sensorInfo, @@ -192,15 +191,14 @@ int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConf return 0; } -void IPARPi::start(const ipa::RPi::StartControls &data, - ipa::RPi::StartControls *result) +void IPARPi::start(const ControlList &controls, ipa::RPi::StartConfig *startConfig) { RPiController::Metadata metadata; - ASSERT(result); - if (!data.controls.empty()) { + ASSERT(startConfig); + if (!controls.empty()) { /* We have been given some controls to action before start. */ - queueRequest(data.controls); + queueRequest(controls); } controller_.SwitchMode(mode_, &metadata); @@ -215,7 +213,7 @@ void IPARPi::start(const ipa::RPi::StartControls &data, if (agcStatus.shutter_time != 0.0 && agcStatus.analogue_gain != 0.0) { ControlList ctrls(sensorCtrls_); applyAGC(&agcStatus, ctrls); - result->controls = std::move(ctrls); + startConfig->controls = std::move(ctrls); } /* @@ -262,7 +260,7 @@ void IPARPi::start(const ipa::RPi::StartControls &data, mistrustCount_ = helper_->MistrustFramesModeSwitch(); } - result->dropFrameCount = dropFrame; + startConfig->dropFrameCount = dropFrame; firstStart_ = false; } -- cgit v1.2.1