From patchwork Tue Sep 8 07:36:38 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28198 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 4B91DC3273 for ; Tue, 8 Sep 2026 07:36:51 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DA1F268616; Tue, 8 Sep 2026 09:36:47 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="IvdXudq3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 364CA68613 for ; Tue, 8 Sep 2026 09:36:44 +0200 (CEST) Received: from pb-laptop.local (185.221.140.18.nat.pool.zt.hu [185.221.140.18]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4C537447 for ; Tue, 8 Sep 2026 09:35:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1788852908; bh=L+XbzB+vNjQDFeTSdQ3McI319JBzcYVPsIHVLZWYKqg=; h=From:To:Subject:Date:From; b=IvdXudq3F3BmlMU+ox8ksdhmkpWvpzpl0PDc6j2Qsygc9HIcvKWvibYm0fQPgyR51 dway78wcLHxbunj3RZ3zIQK8pQCMYONw/220xb4fVhbxYXKPcSP7gMf+OQBgxpmR7Y rAi7w3YYHVW4SbJ1qmtuw1bwPgo6JEmi17I6OJcg= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 1/3] libcamera: v4l2_videodevice: V4L2DeviceFormat: Expand formatting Date: Tue, 8 Sep 2026 09:36:38 +0200 Message-ID: <20260908073640.39654-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Currently, only the size, the pixel format, and the color space is included when a `V4L2DeviceFormat` is formatted into a stream. Print the data about the planes as well (size and bytes-per-line), as it can immensely help debugging if it is readily available in the log. Example: 640x480-YUYV[614400/1280]/Rec709/Rec709/Rec601/Limited where the / pairs are printed inside the "[]" separated by ':'. Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- src/libcamera/v4l2_videodevice.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 41dc5d0f65..bc539884e5 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -447,8 +447,19 @@ std::string V4L2DeviceFormat::toString() const */ std::ostream &operator<<(std::ostream &out, const V4L2DeviceFormat &f) { - out << f.size << "-" << f.fourcc << "/" - << ColorSpace::toString(f.colorSpace); + out << f.size << '-' << f.fourcc << '['; + + for (size_t i = 0; i < f.planesCount; i++) { + const auto &p = f.planes[i]; + + out << p.size << '/' << p.bpl; + + if (i + 1 < f.planesCount) + out << ':'; + } + + out << "]/" << ColorSpace::toString(f.colorSpace); + return out; }