From patchwork Fri Sep 18 13:50:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9666 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 6AA4EBF01C for ; Fri, 18 Sep 2020 13:47:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 474D662FCB; Fri, 18 Sep 2020 15:47:29 +0200 (CEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 178A862F4F for ; Fri, 18 Sep 2020 15:47:26 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id E072940006; Fri, 18 Sep 2020 13:47:24 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 18 Sep 2020 15:50:41 +0200 Message-Id: <20200918135041.91492-9-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200918135041.91492-1-jacopo@jmondi.org> References: <20200918135041.91492-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 8/8] android: camera_device: Add stream mapping log X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hanlinchen@chromium.org Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" To ease following how Android stream gets mapped onto libcamera ones add a (quite verbose) printout before queueing a request to libcamera. The output looks like: 0 - (320x240)[0x00000022] -> (320x240)[NV12] (external) 1 - (640x480)[0x00000021] -> (640x480)[NV12] (internal) Reviewed-by: Hirokazu Honda Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index f7e9a1e5f494..a442495563a6 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1474,9 +1474,12 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques Request *request = camera_->createRequest(reinterpret_cast(descriptor)); + LOG(HAL, Debug) << "Queueing Request to libcamera with " + << descriptor->numBuffers << " streams"; for (unsigned int i = 0; i < descriptor->numBuffers; ++i) { + camera3_stream *camera3Stream = camera3Buffers[i].stream; CameraStream *cameraStream = - static_cast(camera3Buffers[i].stream->priv); + static_cast(camera3Stream->priv); const StreamConfiguration &config = config_->at(cameraStream->index()); Stream *stream = config.stream(); @@ -1487,9 +1490,18 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques descriptor->buffers[i].stream = camera3Buffers[i].stream; descriptor->buffers[i].buffer = camera3Buffers[i].buffer; - /* Mapped streams don't need to be added to the Request. */ - if (cameraStream->type() == CameraStream::Type::Mapped) + std::stringstream ss; + ss << i << " - (" + << camera3Stream->width << "x" << camera3Stream->height << ")" + << "[" << utils::hex(camera3Stream->format) << "] -> " + << "(" << config.size.toString() << ")[" + << config.pixelFormat.toString() << "]"; + + /* Mapped streams don't need buffers added to the Request. */ + if (cameraStream->type() == CameraStream::Type::Mapped) { + LOG(HAL, Debug) << ss.str() << " (mapped)"; continue; + } FrameBuffer *buffer; if (cameraStream->type() == CameraStream::Type::Direct) { @@ -1501,7 +1513,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques */ buffer = createFrameBuffer(*camera3Buffers[i].buffer); descriptor->frameBuffers.emplace_back(buffer); - + LOG(HAL, Debug) << ss.str() << " (external)"; } else { /* * Get the frame buffer from the CameraStream internal @@ -1513,6 +1525,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques * allocator once it has been processed. */ buffer = getBuffer(stream); + LOG(HAL, Debug) << ss.str() << " (internal)"; } if (!buffer) { LOG(HAL, Error) << "Failed to create buffer";