diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2021-03-23 14:36:07 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-03-23 18:43:59 +0200 |
commit | 256b1e0302db64d5453b7d9e7413f183eb77206f (patch) | |
tree | 02f9afafe216be42ecc7603f5888b05def729383 /src/ipa/raspberrypi | |
parent | 90ac9849f47ff3c0e0cd68f63be9dcdd16c7071d (diff) |
ipa: raspberrypi: Move the controller initialise to ipa::init()
The controller initialise is a one-off operation, so move it from
ipa::configure() to ipa::init().
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi')
-rw-r--r-- | src/ipa/raspberrypi/raspberrypi.cpp | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index a5b4b311..bd20b144 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -67,9 +67,8 @@ class IPARPi : public ipa::RPi::IPARPiInterface { public: IPARPi() - : lastMode_({}), controller_(), controllerInit_(false), - frameCount_(0), checkCount_(0), mistrustCount_(0), - lsTable_(nullptr), firstStart_(true) + : lastMode_({}), controller_(), frameCount_(0), checkCount_(0), + mistrustCount_(0), lsTable_(nullptr), firstStart_(true) { } @@ -127,9 +126,6 @@ private: ControlInfoMap ispCtrls_; ControlList libcameraMetadata_; - /* IPA configuration. */ - std::string tuningFile_; - /* Camera sensor params. */ CameraMode mode_; CameraMode lastMode_; @@ -137,7 +133,6 @@ private: /* Raspberry Pi controller specific defines. */ std::unique_ptr<RPiController::CamHelper> helper_; RPiController::Controller controller_; - bool controllerInit_; RPiController::Metadata rpiMetadata_; /* @@ -166,8 +161,6 @@ private: int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConfig) { - tuningFile_ = settings.configurationFile; - /* * Load the "helper" for this sensor. This tells us all the device specific stuff * that the kernel driver doesn't. We only do this the first time; we don't need @@ -193,6 +186,10 @@ int IPARPi::init(const IPASettings &settings, ipa::RPi::SensorConfig *sensorConf sensorConfig->vblankDelay = vblankDelay; sensorConfig->sensorMetadata = sensorMetadata; + /* Load the tuning file for this sensor. */ + controller_.Read(settings.configurationFile.c_str()); + controller_.Initialise(); + return 0; } @@ -372,12 +369,7 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo, /* Pass the camera mode to the CamHelper to setup algorithms. */ helper_->SetCameraMode(mode_); - if (!controllerInit_) { - /* Load the tuning file for this sensor. */ - controller_.Read(tuningFile_.c_str()); - controller_.Initialise(); - controllerInit_ = true; - + if (firstStart_) { /* Supply initial values for frame durations. */ applyFrameDurations(defaultMinFrameDuration, defaultMaxFrameDuration); |