From patchwork Mon Dec 16 12:44:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 2430 Return-Path: Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 251C9601E4 for ; Mon, 16 Dec 2019 13:45:37 +0100 (CET) X-Halon-ID: ebc2056e-2001-11ea-a00b-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac5865.dip0.t-ipconnect.de [84.172.88.101]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id ebc2056e-2001-11ea-a00b-005056917a89; Mon, 16 Dec 2019 13:45:33 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Dec 2019 13:44:56 +0100 Message-Id: <20191216124456.1049508-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191216124456.1049508-1-niklas.soderlund@ragnatech.se> References: <20191216124456.1049508-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] libcamera: Remove buffer index from logging 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: , X-List-Received-Date: Mon, 16 Dec 2019 12:45:37 -0000 The buffer index is a V4L2 concept that will be hidden from users with the introduction of a new FrameBuffer class. In preparation for this, remove the index from log messages. Keep and move one debug log message where the index is available as the V4L2 buffer is being dequeued for the video device and it's useful when debugging. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/cam/capture.cpp | 3 +-- src/libcamera/v4l2_videodevice.cpp | 3 +-- src/qcam/main_window.cpp | 3 +-- test/v4l2_videodevice/buffer_sharing.cpp | 6 ++---- test/v4l2_videodevice/capture_async.cpp | 2 +- test/v4l2_videodevice/v4l2_m2mdevice.cpp | 4 ++-- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp index e665d819fb777a90..4b65b1d0a2dbed35 100644 --- a/src/cam/capture.cpp +++ b/src/cam/capture.cpp @@ -155,7 +155,6 @@ void Capture::requestComplete(Request *request) const std::string &name = streamName_[stream]; info << " " << name - << " (" << buffer->index() << ")" << " seq: " << std::setw(6) << std::setfill('0') << buffer->sequence() << " bytesused: " << buffer->bytesused(); @@ -182,7 +181,7 @@ void Capture::requestComplete(Request *request) std::unique_ptr newBuffer = stream->createBuffer(index); if (!newBuffer) { - std::cerr << "Can't create buffer " << index << std::endl; + std::cerr << "Can't create buffer" << std::endl; return; } diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 992130751286994c..13e023237dab0daf 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1102,6 +1102,7 @@ Buffer *V4L2VideoDevice::dequeueBuffer() return nullptr; } + LOG(V4L2, Debug) << "Dequeuing buffer " << buf.index; ASSERT(buf.index < bufferPool_->count()); auto it = queuedBuffers_.find(buf.index); @@ -1138,8 +1139,6 @@ void V4L2VideoDevice::bufferAvailable(EventNotifier *notifier) if (!buffer) return; - LOG(V4L2, Debug) << "Buffer " << buffer->index() << " is available"; - /* Notify anyone listening to the device. */ bufferReady.emit(buffer); } diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index cca7365ae75687f9..0c7ca61ac12ec41c 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -264,7 +264,6 @@ void MainWindow::requestComplete(Request *request) lastBufferTime_ = buffer->timestamp(); std::cout << "seq: " << std::setw(6) << std::setfill('0') << buffer->sequence() - << " buf: " << buffer->index() << " bytesused: " << buffer->bytesused() << " timestamp: " << buffer->timestamp() << " fps: " << std::fixed << std::setprecision(2) << fps @@ -285,7 +284,7 @@ void MainWindow::requestComplete(Request *request) std::unique_ptr newBuffer = stream->createBuffer(index); if (!newBuffer) { - std::cerr << "Can't create buffer " << index << std::endl; + std::cerr << "Can't create buffer" << std::endl; return; } diff --git a/test/v4l2_videodevice/buffer_sharing.cpp b/test/v4l2_videodevice/buffer_sharing.cpp index 1629f34cfa6c79fe..3a56862cb2b77d38 100644 --- a/test/v4l2_videodevice/buffer_sharing.cpp +++ b/test/v4l2_videodevice/buffer_sharing.cpp @@ -92,8 +92,7 @@ protected: void captureBufferReady(Buffer *buffer) { - std::cout << "Received capture buffer: " << buffer->index() - << " sequence " << buffer->sequence() << std::endl; + std::cout << "Received capture buffer" << std::endl; if (buffer->status() != Buffer::BufferSuccess) return; @@ -104,8 +103,7 @@ protected: void outputBufferReady(Buffer *buffer) { - std::cout << "Received output buffer: " << buffer->index() - << " sequence " << buffer->sequence() << std::endl; + std::cout << "Received output buffer" << std::endl; if (buffer->status() != Buffer::BufferSuccess) return; diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp index 442a4fe56eace57e..f62bbd837b213a0a 100644 --- a/test/v4l2_videodevice/capture_async.cpp +++ b/test/v4l2_videodevice/capture_async.cpp @@ -22,7 +22,7 @@ public: void receiveBuffer(Buffer *buffer) { - std::cout << "Received buffer " << buffer->index() << std::endl; + std::cout << "Buffer received" << std::endl; frames++; /* Requeue the buffer for further use. */ diff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp index 4d3644c2d28792f1..442bcac5dc49cc59 100644 --- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp +++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp @@ -31,7 +31,7 @@ public: void outputBufferComplete(Buffer *buffer) { - cout << "Received output buffer " << buffer->index() << endl; + cout << "Received output buffer" << endl; outputFrames_++; @@ -41,7 +41,7 @@ public: void receiveCaptureBuffer(Buffer *buffer) { - cout << "Received capture buffer " << buffer->index() << endl; + cout << "Received capture buffer" << endl; captureFrames_++;