From f391048a7b987a149d0ba5421846b9b5ab916338 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 13 Oct 2019 22:22:04 +0300 Subject: libcamera: utils: Add hex stream output helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a utils::hex() function that simplifies writing hexadecimal values to an ostream. The function handles the '0x' prefix, the field width and the fill character automatically. Use it through the libcamera code base, and add a test. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/android/camera_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/android') diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index bf991d59..c7c9b3fd 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -640,7 +640,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) << ", direction: " << stream->stream_type << ", width: " << stream->width << ", height: " << stream->height - << ", format: " << std::hex << stream->format; + << ", format: " << utils::hex(stream->format); } /* Hardcode viewfinder role, collecting sizes from the stream config. */ -- cgit v1.2.1