libcamera: ipa_proxy: Report a missing configuration as a warning

When the configuration file for an IPA module is missing, it is reported
as an error in the log, for example:

  ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'imx219.yaml' not found for IPA module 'simple'

This is misleading because several pipelines use uncalibrated.yaml in
such a case and can continue working.  And in case of software ISP,
there is currently no other configuration file so the error is always
reported.

On the other hand, in some other cases the presence of the configuration
file is required and it is an error if it is missing.

Let's introduce a new optional argument to IPAProxy::configurationFile
that specifies a fallback file if the requested file is not found.  If
the primary requested file is not found and a non-empty fallback file is
specified then a warning is logged and the fallback file is looked up.
If neither the fallback file can be found then only then an error is
logged and the method returns an empty string.  This change has also the
benefit of putting the common fallback file ("uncalibrated.yaml")
pattern to a single place.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Milan Zamazal 2024-07-31 20:36:16 +02:00 committed by Kieran Bingham
parent 58f83d70eb
commit 6c17996879
5 changed files with 25 additions and 19 deletions

View file

@ -31,7 +31,8 @@ public:
bool isValid() const { return valid_; }
std::string configurationFile(const std::string &name) const;
std::string configurationFile(const std::string &name,
const std::string &fallbackName = std::string()) const;
protected:
std::string resolvePath(const std::string &file) const;