From patchwork Mon Apr 15 16:56:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 984 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3287760DBF for ; Mon, 15 Apr 2019 18:57:15 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BACA0B81 for ; Mon, 15 Apr 2019 18:57:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1555347434; bh=gk+2Z40UM/TXch3cDOWs9HuvY8eoi8m5fC3GTHxIld0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Btg9B1nAAnDBog3IToivJC4EIoBu1JNu9e11hImXgqgGxzSVoV7SEqE+uzi69edo3 qvwNUJ2UGRMsrmv/lvMPhmZG8T8yh2UyEUWn8MjqwDnQEJbXwp7VDOoO+ZlckyjJSQ rIVq4eYrZQ/bvrOo6reEZXIDtgdLtCfIKOtqQa6U= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Apr 2019 19:56:52 +0300 Message-Id: <20190415165700.22970-4-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415165700.22970-1-laurent.pinchart@ideasonboard.com> References: <20190415165700.22970-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 03/11] 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: Mon, 15 Apr 2019 16:57:17 -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