summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-09-01 15:40:49 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-09-18 11:31:55 +0200
commitaf264ec75092ecdc8d0a4791379e234e81ec42fc (patch)
treefaa0b8123a9790fb8315482e0d0753f8b0524ca9 /src
parent843565c6ec6813d77ff9417413198228d5428356 (diff)
android: camera_device: Add debug to stream initialization
Add debug printouts to the CameraDevice::initializeStreamConfigurations() function that help to follow the process of building the stream configurations map. Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_device.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 3be2dac2..d3a53c94 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -369,12 +369,19 @@ int CameraDevice::initializeStreamConfigurations()
const std::vector<PixelFormat> &libcameraFormats =
camera3Format.libcameraFormats;
+ LOG(HAL, Debug) << "Trying to map Android format "
+ << camera3Format.name;
+
/*
* JPEG is always supported, either produced directly by the
* camera, or encoded in the HAL.
*/
if (androidFormat == HAL_PIXEL_FORMAT_BLOB) {
formatsMap_[androidFormat] = formats::MJPEG;
+ LOG(HAL, Debug) << "Mapped Android format "
+ << camera3Format.name << " to "
+ << formats::MJPEG.toString()
+ << " (fixed mapping)";
continue;
}
@@ -385,6 +392,8 @@ int CameraDevice::initializeStreamConfigurations()
PixelFormat mappedFormat;
for (const PixelFormat &pixelFormat : libcameraFormats) {
+ LOG(HAL, Debug) << "Testing " << pixelFormat.toString();
+
/*
* The stream configuration size can be adjusted,
* not the pixel format.
@@ -420,14 +429,22 @@ int CameraDevice::initializeStreamConfigurations()
* stream configurations map, by testing the image resolutions.
*/
formatsMap_[androidFormat] = mappedFormat;
+ LOG(HAL, Debug) << "Mapped Android format "
+ << camera3Format.name << " to "
+ << mappedFormat.toString();
for (const Size &res : cameraResolutions) {
cfg.pixelFormat = mappedFormat;
cfg.size = res;
CameraConfiguration::Status status = cameraConfig->validate();
- if (status != CameraConfiguration::Valid)
+ if (status != CameraConfiguration::Valid) {
+ LOG(HAL, Debug) << cfg.toString()
+ << " not supported";
continue;
+ }
+
+ LOG(HAL, Debug) << cfg.toString() << " supported";
streamConfigurations_.push_back({ res, androidFormat });