[libcamera-devel,v2,24/27] qcam: Print bytesused for all planes
diff mbox series

Message ID 20210906020100.14430-25-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series
  • libcamera: Handle fallout of FrameBuffer offset support
Related show

Commit Message

Laurent Pinchart Sept. 6, 2021, 2 a.m. UTC
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@ideasonboard.com>
---
 src/qcam/main_window.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Jean-Michel Hautbois Sept. 6, 2021, 9:32 a.m. UTC | #1
Hi Laurent,

On 06/09/2021 04:00, Laurent Pinchart wrote:
> 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@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("/")
I would'nt think about using join :-) thx.
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>

>  		<< "timestamp:" << metadata.timestamp
>  		<< "fps:" << Qt::fixed << qSetRealNumberPrecision(2) << fps;
>  
>

Patch
diff mbox series

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;