[libcamera-devel] [PATCH 14/15] android: camera_device: Add stream mapping log
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Oct 5 12:46:48 CEST 2020
From: Jacopo Mondi <jacopo at jmondi.org>
To ease following how Android streams get mapped to libcamera ones
add a (quite verbose) printout before queueing a request to libcamera.
The output looks like:
0 - (320x240)[0x00000022] -> (320x240)[NV12] (direct)
1 - (640x480)[0x00000021] -> (640x480)[NV12] (internal)
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh at chromium.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/android/camera_device.cpp | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 186c9f724c3e..1a9af2e34340 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1379,7 +1379,10 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
Request *request =
camera_->createRequest(reinterpret_cast<uint64_t>(descriptor));
+ LOG(HAL, Debug) << "Queueing Request to libcamera with "
+ << descriptor->numBuffers << " HAL streams";
for (unsigned int i = 0; i < descriptor->numBuffers; ++i) {
+ camera3_stream *camera3Stream = camera3Buffers[i].stream;
CameraStream *cameraStream =
static_cast<CameraStream *>(camera3Buffers[i].stream->priv);
@@ -1390,6 +1393,13 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
descriptor->buffers[i].stream = camera3Buffers[i].stream;
descriptor->buffers[i].buffer = camera3Buffers[i].buffer;
+ std::stringstream ss;
+ ss << i << " - (" << camera3Stream->width << "x"
+ << camera3Stream->height << ")"
+ << "[" << utils::hex(camera3Stream->format) << "] -> "
+ << "(" << cameraStream->size().toString() << ")["
+ << cameraStream->format().toString() << "]";
+
/*
* Inspect the camera stream type, create buffers opportunely
* and add them to the Request if required.
@@ -1401,6 +1411,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
* Mapped streams don't need buffers added to the
* Request.
*/
+ LOG(HAL, Debug) << ss.str() << " (mapped)";
continue;
case CameraStream::Type::Direct:
@@ -1412,6 +1423,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
*/
buffer = createFrameBuffer(*camera3Buffers[i].buffer);
descriptor->frameBuffers.emplace_back(buffer);
+ LOG(HAL, Debug) << ss.str() << " (direct)";
break;
case CameraStream::Type::Internal:
@@ -1423,6 +1435,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
* once it has been processed.
*/
buffer = cameraStream->getBuffer();
+ LOG(HAL, Debug) << ss.str() << " (internal)";
break;
}
if (!buffer) {
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list