libcamera: global_configuration: Override options with environment variables

libcamera supports several environment variables that can override
configuration options. This requires components that use such overrides
to call the special envOption() and envListOption() functions, spreading
knowledge of the overrides through the code base. This will hinder
future enhancements to the global configuration, such as implementing
per-camera options that will override pipeline handler-level options. To
prepare for that, move handling of the environment variables to the
GlobalConfiguration class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2025-10-15 17:21:56 +03:00
parent f06ad77043
commit 16063986bb
6 changed files with 124 additions and 86 deletions
@@ -42,13 +42,6 @@ public:
std::optional<std::vector<std::string>> listOption(
const std::initializer_list<std::string_view> confPath) const;
std::optional<std::string> envOption(
const char *const envVariable,
const std::initializer_list<std::string_view> confPath) const;
std::optional<std::vector<std::string>> envListOption(
const char *const envVariable,
const std::initializer_list<std::string_view> confPath,
const std::string delimiter = ":") const;
private:
void load();