summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-01-11 17:04:27 +0100
committerJacopo Mondi <jacopo@jmondi.org>2019-01-15 09:29:00 +0100
commitfd0339da1a7c989a0677fb56168839972db9e2ba (patch)
tree31318789f3254936fa6f48c427a4dc8451a259dd
parentbced32d514bb36b97f4dd045f4ee6919e1642aa0 (diff)
libcamera: Add debug printouts
Add a few debug printouts that help follow the library intialization process: what pipeline handlers are registered, what media devices are created, and which pipeline manager gets matches with the current system. The resulting output is the following, on IPU3 devices: DBG pipeline_handler.cpp:119 Pipeline handler: "PipeHandlerVimc" registered DBG pipeline_handler.cpp:119 Pipeline handler: "PipelineHandlerIPU3" registered DBG device_enumerator.cpp:214 New media device: ipu3-imgu created from: /dev/media0 DBG device_enumerator.cpp:214 New media device: ipu3-cio2 created from: /dev/media1 DBG device_enumerator.cpp:255 Succesfull match for media device: ipu3-cio2 DBG device_enumerator.cpp:255 Succesfull match for media device: ipu3-imgu DBG pipeline_handler.cpp:150 Pipeline handler: "PipelineHandlerIPU3" matched Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/device_enumerator.cpp8
-rw-r--r--src/libcamera/pipeline_handler.cpp5
2 files changed, 11 insertions, 2 deletions
diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
index 0d18e755..febb83da 100644
--- a/src/libcamera/device_enumerator.cpp
+++ b/src/libcamera/device_enumerator.cpp
@@ -211,6 +211,9 @@ int DeviceEnumerator::addDevice(const std::string &devnode)
return ret;
}
+ LOG(Debug) << "New media device \"" << media->driver()
+ << "\" created from " << devnode;
+
/* Associate entities to device node paths. */
for (MediaEntity *entity : media->entities()) {
if (entity->deviceMajor() == 0 && entity->deviceMinor() == 0)
@@ -248,8 +251,11 @@ MediaDevice *DeviceEnumerator::search(const DeviceMatch &dm) const
if (dev->busy())
continue;
- if (dm.match(dev))
+ if (dm.match(dev)) {
+ LOG(Debug) << "Successful match for media device "
+ << dev->driver();
return dev;
+ }
}
return nullptr;
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index ee769487..b5a85749 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -116,6 +116,7 @@ void PipelineHandlerFactory::registerType(const std::string &name,
return;
}
+ LOG(Debug) << "Registered pipeline handler: \"" << name << "\"";
factories[name] = factory;
}
@@ -145,8 +146,10 @@ PipelineHandler *PipelineHandlerFactory::create(const std::string &name,
PipelineHandler *pipe = it->second->create();
- if (pipe->match(enumerator))
+ if (pipe->match(enumerator)) {
+ LOG(Debug) << "Pipeline handler \"" << name << "\" matched";
return pipe;
+ }
delete pipe;
return nullptr;