diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2021-03-08 16:48:28 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2021-03-09 11:49:23 +0900 |
commit | 45ebe9a209fc5bcce649b8b3f27f80131fc4e2c7 (patch) | |
tree | 43c5f252a81f6219bdfef96d3c184beef5077a0e /src/ipa | |
parent | 0612bef6013e31345dd9181869775fd704026f52 (diff) |
ipa: raspberrypi: Use direct return value for configure()
Now that we support returning int directly in addition to other output
parameters, improve the configure() function in the raspberrypi IPA
interface.
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa')
-rw-r--r-- | src/ipa/raspberrypi/raspberrypi.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 85a2b846..7904225a 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -84,11 +84,11 @@ public: ipa::RPi::StartControls *result) override; void stop() override {} - void configure(const CameraSensorInfo &sensorInfo, - const std::map<unsigned int, IPAStream> &streamConfig, - const std::map<unsigned int, ControlInfoMap> &entityControls, - const ipa::RPi::ConfigInput &data, - ipa::RPi::ConfigOutput *response, int32_t *ret) override; + int configure(const CameraSensorInfo &sensorInfo, + const std::map<unsigned int, IPAStream> &streamConfig, + const std::map<unsigned int, ControlInfoMap> &entityControls, + const ipa::RPi::ConfigInput &data, + ipa::RPi::ConfigOutput *response) override; void mapBuffers(const std::vector<IPABuffer> &buffers) override; void unmapBuffers(const std::vector<unsigned int> &ids) override; void signalStatReady(const uint32_t bufferId) override; @@ -290,16 +290,15 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo) mode_.max_frame_length = sensorInfo.maxFrameLength; } -void IPARPi::configure(const CameraSensorInfo &sensorInfo, - [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, - const std::map<unsigned int, ControlInfoMap> &entityControls, - const ipa::RPi::ConfigInput &ipaConfig, - ipa::RPi::ConfigOutput *result, int32_t *ret) +int IPARPi::configure(const CameraSensorInfo &sensorInfo, + [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, + const std::map<unsigned int, ControlInfoMap> &entityControls, + const ipa::RPi::ConfigInput &ipaConfig, + ipa::RPi::ConfigOutput *result) { if (entityControls.size() != 2) { LOG(IPARPI, Error) << "No ISP or sensor controls found."; - *ret = -1; - return; + return -1; } result->params = 0; @@ -309,14 +308,12 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, if (!validateSensorControls()) { LOG(IPARPI, Error) << "Sensor control validation failed."; - *ret = -1; - return; + return -1; } if (!validateIspControls()) { LOG(IPARPI, Error) << "ISP control validation failed."; - *ret = -1; - return; + return -1; } /* Setup a metadata ControlList to output metadata. */ @@ -334,8 +331,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, if (!helper_) { LOG(IPARPI, Error) << "Could not create camera helper for " << cameraName; - *ret = -1; - return; + return -1; } /* @@ -403,7 +399,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, lastMode_ = mode_; - *ret = 0; + return 0; } void IPARPi::mapBuffers(const std::vector<IPABuffer> &buffers) |