diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2020-11-27 14:56:12 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2020-12-07 14:03:38 +0000 |
commit | ee477efde8e49e26cc02437fd50a45cd439ee65e (patch) | |
tree | c31d8625f524aacc831251a6cb06863f8ab4193f /src/ipa | |
parent | 8fed613562677dd2402b6f67f0090fcba3301f1f (diff) |
pipeline: ipa: raspberrypi: Handle failures during IPA configuration
If the IPA fails during configuration, return an error flag to the
pipeline handler and fail the use case gracefully.
At present, the IPA configuration can fail for the following reasons:
- The sensor is not recognised, and fails to open a CamHelper object.
- The pipeline handler did not pass in controls for the ISP and sensor.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa')
-rw-r--r-- | src/ipa/raspberrypi/raspberrypi.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 29d48b1b..5824d3b5 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -197,8 +197,11 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, const IPAOperationData &ipaConfig, IPAOperationData *result) { - if (entityControls.empty()) + if (entityControls.size() != 2) { + LOG(IPARPI, Error) << "No ISP or sensor controls found."; + result->operation = RPi::IPA_CONFIG_FAILED; return; + } result->operation = 0; @@ -217,6 +220,13 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo, if (!helper_) { helper_ = std::unique_ptr<RPiController::CamHelper>(RPiController::CamHelper::Create(cameraName)); + if (!helper_) { + LOG(IPARPI, Error) << "Could not create camera helper for " + << cameraName; + result->operation = RPi::IPA_CONFIG_FAILED; + return; + } + /* * Pass out the sensor config to the pipeline handler in order * to setup the staggered writer class. |