[v3,10/14] config: Look up pipelines match list in configuration file
diff mbox series

Message ID 20240627145156.1094127-11-mzamazal@redhat.com
State Superseded
Headers show
Series
  • Add global configuration file
Related show

Commit Message

Milan Zamazal June 27, 2024, 2:51 p.m. UTC
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
---
 src/libcamera/camera_manager.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index 7c5e5606..836a7bc9 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -113,14 +113,15 @@  void CameraManager::Private::createPipelineHandlers()
 	 * file and only fallback on environment variable or all handlers, if
 	 * there is no configuration file.
 	 */
-	const char *pipesList =
-		utils::secure_getenv("LIBCAMERA_PIPELINES_MATCH_LIST");
-	if (pipesList) {
+	std::optional<std::string> pipesList =
+		GlobalConfiguration::envOption("LIBCAMERA_PIPELINES_MATCH_LIST",
+					       "pipelines_match_list");
+	if (pipesList.has_value()) {
 		/*
 		 * When a list of preferred pipelines is defined, iterate
 		 * through the ordered list to match the enumerated devices.
 		 */
-		for (const auto &pipeName : utils::split(pipesList, ",")) {
+		for (const auto &pipeName : utils::split(pipesList.value(), ",")) {
 			const PipelineHandlerFactoryBase *factory;
 			factory = PipelineHandlerFactoryBase::getFactoryByName(pipeName);
 			if (!factory)