[libcamera-devel] [PATCH v2 24/27] qcam: Print bytesused for all planes

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Sep 6 04:00:57 CEST 2021


Fix the debug message that prints frame metadata to print the number of
bytes used for each plane, not just the first one.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/qcam/main_window.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index ac853e360aea..0a00b1001570 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -20,6 +20,7 @@
 #include <QInputDialog>
 #include <QMutexLocker>
 #include <QStandardPaths>
+#include <QStringList>
 #include <QTimer>
 #include <QToolBar>
 #include <QToolButton>
@@ -754,9 +755,13 @@ void MainWindow::processViewfinder(FrameBuffer *buffer)
 	fps = lastBufferTime_ && fps ? 1000000000.0 / fps : 0.0;
 	lastBufferTime_ = metadata.timestamp;
 
+	QStringList bytesused;
+	for (const FrameMetadata::Plane &plane : metadata.planes())
+		bytesused << QString::number(plane.bytesused);
+
 	qDebug().noquote()
 		<< QString("seq: %1").arg(metadata.sequence, 6, 10, QLatin1Char('0'))
-		<< "bytesused:" << metadata.planes()[0].bytesused
+		<< "bytesused:" << bytesused.join("/")
 		<< "timestamp:" << metadata.timestamp
 		<< "fps:" << Qt::fixed << qSetRealNumberPrecision(2) << fps;
 
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list