summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-06-14 13:13:32 +0100
committerNaushir Patuck <naush@raspberrypi.com>2023-06-19 11:31:16 +0100
commit0d1e402e1b6d0fce1e0003bf3deebb21594d5906 (patch)
tree19998e20979804652712dec642e0c338c219a3aa /src
parent618b9aaa17713bed359112bda358e81e1eaea86c (diff)
pipeline: rpi: Do not return an error from pipeline config file handling
If a user provided pipeline config file is not present, or if the version reported in the file is invalid, do not return with an error when creating the pipeline handler. Instead, log a warning message and return success with default pipeline config values used. This now matches the behaviour when the pipeline config file could not be parsed correctly, and we revert to default values. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/rpi/common/pipeline_base.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index 1e20fc2d..df748292 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -1093,8 +1093,9 @@ int CameraData::loadPipelineConfiguration()
File file(filename);
if (!file.open(File::OpenModeFlag::ReadOnly)) {
- LOG(RPI, Error) << "Failed to open configuration file '" << filename << "'";
- return -EIO;
+ LOG(RPI, Warning) << "Failed to open configuration file '" << filename << "'"
+ << ", using defaults";
+ return 0;
}
LOG(RPI, Info) << "Using configuration file '" << filename << "'";
@@ -1107,8 +1108,9 @@ int CameraData::loadPipelineConfiguration()
std::optional<double> ver = (*root)["version"].get<double>();
if (!ver || *ver != 1.0) {
- LOG(RPI, Error) << "Unexpected configuration file version reported";
- return -EINVAL;
+ LOG(RPI, Warning) << "Unexpected configuration file version reported: "
+ << *ver;
+ return 0;
}
const YamlObject &phConfig = (*root)["pipeline_handler"];