From ac209efabf44827eb73f7f4d8baaffa9c1a58665 Mon Sep 17 00:00:00 2001 From: Hirokazu Honda Date: Sat, 3 Apr 2021 22:10:14 +0900 Subject: android: CameraDevice: Log rotation variables in camera3_stream |rotation| and |crop_rotate_scale_degrees| are important info of a configuration. They should be logged. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/android/camera_device.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 249fd8cc..6e003b9d 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -298,6 +298,21 @@ bool isValidRequest(camera3_capture_request_t *camera3Request) return true; } +const char *rotationToString(int rotation) +{ + switch (rotation) { + case CAMERA3_STREAM_ROTATION_0: + return "0"; + case CAMERA3_STREAM_ROTATION_90: + return "90"; + case CAMERA3_STREAM_ROTATION_180: + return "180"; + case CAMERA3_STREAM_ROTATION_270: + return "270"; + } + return "INVALID"; +} + #if defined(OS_CHROMEOS) /* * Check whether the crop_rotate_scale_degrees values for all streams in @@ -1678,6 +1693,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) << ", width: " << stream->width << ", height: " << stream->height << ", format: " << utils::hex(stream->format) + << ", rotation: " << rotationToString(stream->rotation) +#if defined(OS_CHROMEOS) + << ", crop_rotate_scale_degrees: " + << rotationToString(stream->crop_rotate_scale_degrees) +#endif << " (" << format.toString() << ")"; if (!format.isValid()) -- cgit v1.2.1