[libcamera-devel] [PATCH v8 2/8] libcamera: camera: Reset basefield to decimal

Jacopo Mondi jacopo at jmondi.org
Fri Apr 19 15:25:25 CEST 2019


When logging the camera configuration, the same ostringstream instance
is used to assemble a message describing configuration of all the
configured streams.

After the first stream configuration has been assembled, the use of
std::hex modifies the ostringstream basefield, causing all successive
integers values inserted in the stream to be expressed as hexadecimals.

Fix that by resetting the stream's basefield to decimal, before
assembling a stream configuration description.

Before this patch:
INFO Camera camera.cpp:615  (0) 640x480-0x3231564e (1) 140xa0-0x3231564e
After this patch:
INFO Camera camera.cpp:616  (0) 640x480-0x3231564e (1) 320x160-0x3231564e

Fixes: 9c9078133216 ("libcamera: camera: Log requested configuration in configureStreams()")
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/camera.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index d7a39ca6af12..655996f26224 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -597,7 +597,7 @@ int Camera::configureStreams(const CameraConfiguration &config)
 			return -EINVAL;
 
 		const StreamConfiguration &cfg = config[stream];
-		msg << " (" << index << ") " << cfg.toString();
+		msg << std::dec << " (" << index << ") " << cfg.toString();
 
 		index++;
 	}
-- 
2.21.0



More information about the libcamera-devel mailing list