[07/12] libcamera: delayed_controls: Add some logging
diff mbox series

Message ID 20240313105645.120317-8-stefan.klug@ideasonboard.com
State Superseded
Headers show
Series
  • Preparation for per-frame-controls and initial tests
Related show

Commit Message

Stefan Klug March 13, 2024, 10:56 a.m. UTC
This replaces changes the log output to a more compact form.
There might be different opinions on that one

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/libcamera/delayed_controls.cpp | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index 59314388..c46e54d1 100644
--- a/src/libcamera/delayed_controls.cpp
+++ b/src/libcamera/delayed_controls.cpp
@@ -104,6 +104,8 @@  DelayedControls::DelayedControls(V4L2Device *device,
 		maxDelay_ = std::max(maxDelay_, controlParams_[id].delay);
 	}
 
+	LOG(DelayedControls, Debug) << "Maximum delay: " << maxDelay_;
+
 	reset();
 }
 
@@ -212,6 +214,14 @@  bool DelayedControls::push(const ControlList &controls)
 
 bool DelayedControls::pushForFrame(uint32_t sequence, const ControlList &controls)
 {
+	LOG(DelayedControls, Debug) << "push: " << sequence;
+	auto idMap = controls.idMap();
+	if (idMap) {
+		for (const auto &[id, value] : controls) {
+			LOG(DelayedControls, Debug) << "  " << idMap->at(id)->name() << " : " << value.toString();
+		}
+	}
+
 	if (sequence < queueIndex_) {
 		LOG(DelayedControls, Debug) << "Got updated data for frame:" << sequence;
 	}
@@ -320,6 +330,7 @@  bool DelayedControls::pushForFrame(uint32_t sequence, const ControlList &control
  */
 ControlList DelayedControls::get(uint32_t sequence)
 {
+	LOG(DelayedControls, Debug) << "get " << sequence << ":";
 	ControlList out(device_->controls());
 	for (const auto &ctrl : values_) {
 		const ControlId *id = ctrl.first;
@@ -328,9 +339,8 @@  ControlList DelayedControls::get(uint32_t sequence)
 		out.set(id->id(), info);
 
 		LOG(DelayedControls, Debug)
-			<< "Reading " << id->name()
-			<< " to " << info.toString()
-			<< " at index " << sequence;
+			<< "  " << id->name()
+			<< ": " << info.toString();
 	}
 
 	return out;