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>
This commit is contained in:
parent
618b9aaa17
commit
0d1e402e1b
1 changed files with 6 additions and 4 deletions
|
@ -1093,8 +1093,9 @@ int CameraData::loadPipelineConfiguration()
|
||||||
File file(filename);
|
File file(filename);
|
||||||
|
|
||||||
if (!file.open(File::OpenModeFlag::ReadOnly)) {
|
if (!file.open(File::OpenModeFlag::ReadOnly)) {
|
||||||
LOG(RPI, Error) << "Failed to open configuration file '" << filename << "'";
|
LOG(RPI, Warning) << "Failed to open configuration file '" << filename << "'"
|
||||||
return -EIO;
|
<< ", using defaults";
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(RPI, Info) << "Using configuration file '" << filename << "'";
|
LOG(RPI, Info) << "Using configuration file '" << filename << "'";
|
||||||
|
@ -1107,8 +1108,9 @@ int CameraData::loadPipelineConfiguration()
|
||||||
|
|
||||||
std::optional<double> ver = (*root)["version"].get<double>();
|
std::optional<double> ver = (*root)["version"].get<double>();
|
||||||
if (!ver || *ver != 1.0) {
|
if (!ver || *ver != 1.0) {
|
||||||
LOG(RPI, Error) << "Unexpected configuration file version reported";
|
LOG(RPI, Warning) << "Unexpected configuration file version reported: "
|
||||||
return -EINVAL;
|
<< *ver;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const YamlObject &phConfig = (*root)["pipeline_handler"];
|
const YamlObject &phConfig = (*root)["pipeline_handler"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue