From patchwork Tue Apr 16 22:08:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1012 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EC4960004 for ; Wed, 17 Apr 2019 00:08:52 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 43B32E2 for ; Wed, 17 Apr 2019 00:08:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1555452532; bh=M3RMGnnhqJpI/UHN0JnapR03W/XkdfDLaBF92Mw1ZQY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aSfu1cXppVEsvL9tda2RyZphI2eEKFAQcnOGhHfASMPpHsDF6yGWYtsWR4XfDNWCt 2zeMO7679tlElhJ7P4HgY5lZ3BEeXsBjSC6fWkGcVTiRR6KC3iI7EbIvpB/hlU2jRn yWSSK4r1qA9RnoWah8o43UTx1UwVuV4fPtQQBVzs= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 17 Apr 2019 01:08:29 +0300 Message-Id: <20190416220839.1577-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190416220839.1577-1-laurent.pinchart@ideasonboard.com> References: <20190416220839.1577-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 03/13] libcamera: camera: Log requested configuration in configureStreams() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2019 22:08:53 -0000 The IPU3 pipeline handler logs the requested configuration in its configureStreams() handler. This is useful for other pipeline handlers as well, move it to the Camera class. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- src/libcamera/camera.cpp | 14 ++++++++++++++ src/libcamera/pipeline/ipu3/ipu3.cpp | 6 ------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index bdf14b31d8ee..55f724a8db17 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -5,6 +5,8 @@ * camera.cpp - Camera device */ +#include + #include #include #include @@ -595,11 +597,23 @@ int Camera::configureStreams(const CameraConfiguration &config) return -EINVAL; } + std::ostringstream msg("configuring streams:"); + unsigned int index = 0; + for (Stream *stream : config) { if (streams_.find(stream) == streams_.end()) return -EINVAL; + + const StreamConfiguration &cfg = config[stream]; + msg << " (" << index << ") " << cfg.width << "x" + << cfg.height << "-0x" << std::hex << std::setfill('0') + << std::setw(8) << cfg.pixelFormat; + + index++; } + LOG(Camera, Info) << msg.str(); + ret = pipe_->configureStreams(this, config); if (ret) return ret; diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index ca09da753b90..ff72be14d696 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -242,12 +242,6 @@ int PipelineHandlerIPU3::configureStreams(Camera *camera, ImgUDevice *imgu = data->imgu_; int ret; - LOG(IPU3, Info) - << "Requested image format " << cfg.width << "x" - << cfg.height << "-0x" << std::hex << std::setfill('0') - << std::setw(8) << cfg.pixelFormat << " on camera '" - << camera->name() << "'"; - /* * Verify that the requested size respects the IPU3 alignement * requirements (the image width shall be a multiple of 8 pixels and