summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2025-01-10 04:30:03 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2025-01-14 16:38:04 +0200
commit31a7378c879a09e88c8908c6743c9a120c66a3c5 (patch)
tree8579983300623603e6667b8b4881cd8025edca2b /src
parent2ae7b2ff7438a4deecff2a8b5de685cc14e5cd44 (diff)
libcamera: pipeline_handler: Enable silent configuration file lookup
The PipelineHandler::configurationFile() function prints an error message when no configuration file is found. It can be useful for pipeline handlers to silence the lookup operation and handle errors themselves. Add a silent parameter to the function to enable this. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Julien Vuillaumier <julien.vuillaumier@nxp.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline_handler.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index caa5c20e..d84dff3c 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -581,6 +581,7 @@ void PipelineHandler::cancelRequest(Request *request)
* \brief Retrieve the absolute path to a platform configuration file
* \param[in] subdir The pipeline handler specific subdirectory name
* \param[in] name The configuration file name
+ * \param[in] silent Disable error messages
*
* This function locates a named platform configuration file and returns
* its absolute path to the pipeline handler. It searches the following
@@ -596,7 +597,8 @@ void PipelineHandler::cancelRequest(Request *request)
* string if no configuration file can be found
*/
std::string PipelineHandler::configurationFile(const std::string &subdir,
- const std::string &name) const
+ const std::string &name,
+ bool silent) const
{
std::string confPath;
struct stat statbuf;
@@ -626,9 +628,11 @@ std::string PipelineHandler::configurationFile(const std::string &subdir,
if (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG)
return confPath;
- LOG(Pipeline, Error)
- << "Configuration file '" << confPath
- << "' not found for pipeline handler '" << PipelineHandler::name() << "'";
+ if (!silent)
+ LOG(Pipeline, Error)
+ << "Configuration file '" << confPath
+ << "' not found for pipeline handler '"
+ << PipelineHandler::name() << "'";
return std::string();
}