@@ -329,10 +329,17 @@ bool PipelineHandlerVirtual::match([[maybe_unused]] DeviceEnumerator *enumerator
created_ = true;
- File file(configurationFile("virtual", "virtual.yaml"));
- bool isOpen = file.open(File::OpenModeFlag::ReadOnly);
- if (!isOpen) {
- LOG(Virtual, Error) << "Failed to open config file: " << file.fileName();
+ std::string configFile = configurationFile("virtual", "virtual.yaml", true);
+ if (configFile.empty()) {
+ LOG(Virtual, Debug)
+ << "Configuration file not found, skipping virtual cameras";
+ return false;
+ }
+
+ File file(configFile);
+ if (!file.open(File::OpenModeFlag::ReadOnly)) {
+ LOG(Virtual, Error)
+ << "Failed to open config file `" << file.fileName() << "`";
return false;
}
The virtual pipeline handler prints an error message when its configuration file can't be opened. Not providing a configuration file is the default method to disable virtual cameras, so this error is confusing for users. Replace it with a debug message when the configuration file is not found, and keep an error message when it exists but can't be opened. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- src/libcamera/pipeline/virtual/virtual.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)