From patchwork Tue Nov 17 15:15:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28952 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 EA72CC3355 for ; Tue, 17 Nov 2026 15:15:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A9B0E6A895; Tue, 17 Nov 2026 16:15:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="hjRgLMGT"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E42F6A88C for ; Tue, 17 Nov 2026 16:15:12 +0100 (CET) Received: from ping.linuxembedded.co.uk (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5BA482022; Tue, 17 Nov 2026 16:12:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794928364; bh=duTwtMDpLzPbbj0xAPi/Fz8IRgYwwz0J5dS3a4gRTnc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hjRgLMGTL7qGvMw6GK+9yrOtaH294Xd9nIbHZ580Jf8/ykOUredqcShZdSi3vafhF i75RjFOnmcZkoT10H+2zciwsdlm460pzW5xSlJVzS2fo3kC8NuQtic9aPrkeE+wSNB A549oVc8Q+8gkLIyQvNksAGCz9rZcOHSLwpayziI= From: Kieran Bingham Date: Tue, 17 Nov 2026 15:15:01 +0000 Subject: [PATCH v3 1/2] libcamera: camera_sensor: Extend reporting in getFormat() MIME-Version: 1.0 Message-Id: <20261117-kbingham-orientation-v3-1-b86563a93c34@ideasonboard.com> References: <20261117-kbingham-orientation-v3-0-b86563a93c34@ideasonboard.com> In-Reply-To: <20261117-kbingham-orientation-v3-0-b86563a93c34@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Jacopo Mondi X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794928511; l=2128; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=duTwtMDpLzPbbj0xAPi/Fz8IRgYwwz0J5dS3a4gRTnc=; b=wgkwtNOoYrh4vGrOJyJyRkc9uw8cSejkDaEUi7eiQkOdEoNVQwNNj5j+Me/yNhiKHMqLIMkbq r0Hru3tQFdOC+B2MYuNuDAV1roQArjGtxmwGDzRBNABZaxN1B85Bqp4 X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=FVXKN7YuwHc6UtbRUeTMAmranfsQomA+vnilfglWdaY= 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" When a pipeline handler asks the CameraSensor for a format, which is not achievable, it can be very helpful to the user to identify what size was requested and why it could not be provided within any constrained maximum size. This can make otherwise difficult to diagnose user errors visible and quickly correctable. Both of the CameraSensorRaw and CameraSensorLegacy are updated accordingly but that likely means these two classes could soon benefit from a more common base class to share otherwise identical code. Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- v2: - Keep log level as Debug v3: - Keep log level as Debug in *both* cases --- src/libcamera/sensor/camera_sensor_legacy.cpp | 4 +++- src/libcamera/sensor/camera_sensor_raw.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index 792e4b09d4fa..0e2085d91345 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -759,7 +759,9 @@ CameraSensorLegacy::getFormat(std::span mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Debug) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; } diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index 55b386cef3f3..5caa9122f962 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -821,7 +821,9 @@ CameraSensorRaw::getFormat(std::span mbusCodes, } if (!bestSize) { - LOG(CameraSensor, Debug) << "No supported format or size found"; + LOG(CameraSensor, Debug) + << "No supported format or size found. Requested " + << size << " with a maximum size " << maxSize; return {}; } From patchwork Tue Nov 17 15:15:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 28951 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 8EC13C3304 for ; Tue, 17 Nov 2026 15:15:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8C46B6A8A0; Tue, 17 Nov 2026 16:15:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="aURlas81"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 69CB26A887 for ; Tue, 17 Nov 2026 16:15:12 +0100 (CET) Received: from ping.linuxembedded.co.uk (cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 936D920E4; Tue, 17 Nov 2026 16:12:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1794928364; bh=PhVjTeqOkuP0+xFtpKqTFEW6FI4+xjj56T9zFZmL9Ew=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aURlas817O9+IhdYJFT8ze2SbnpFaekGxaEpZ+EJ0r7kyPnSlaqhmapuFznsU9Yog 9moNRCkOC+Mxd5DqUQ0CBLgbHJTx5qPLKJM7KvU6qq/IyZhx3K7I6MAbdkUpW7t9p9 HeJleS4+O6IcsOkznrmGoTYe6cXxpHRzNKzv0BuA= From: Kieran Bingham Date: Tue, 17 Nov 2026 15:15:02 +0000 Subject: [PATCH v3 2/2] apps: cam: Support full orientation options MIME-Version: 1.0 Message-Id: <20261117-kbingham-orientation-v3-2-b86563a93c34@ideasonboard.com> References: <20261117-kbingham-orientation-v3-0-b86563a93c34@ideasonboard.com> In-Reply-To: <20261117-kbingham-orientation-v3-0-b86563a93c34@ideasonboard.com> To: libcamera-devel@lists.libcamera.org Cc: Kieran Bingham , Jacopo Mondi , =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1794928511; l=2689; i=kieran.bingham@ideasonboard.com; s=20260207; h=from:subject:message-id; bh=PhVjTeqOkuP0+xFtpKqTFEW6FI4+xjj56T9zFZmL9Ew=; b=V8wVNtnMiLUDE3n1yzCR+YJzN9wzY7ebNdhjDm04CDYIwsusGu4c6tHviE3oheowmuVvpYxkx QiQPAMdYhnPBreSsAcB/wIjtZdmELw9buVIZ0VWk6dsAmhRzslwXlAa X-Developer-Key: i=kieran.bingham@ideasonboard.com; a=ed25519; pk=FVXKN7YuwHc6UtbRUeTMAmranfsQomA+vnilfglWdaY= 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" The Orientation control was implemented in commit 7e5f1e1cedf5 ("apps: cam: Add option to set stream orientation") but did not fully add all of the supported Orientation types. The upcoming dewarp support on RkISP1 will provide full rotation implementation options, including previously difficult '90' degree rotations. Extend the cam application to support setting any of the valid options. The existing 'mirror' and 'flip' options are not consistent with the rest of the option definitions, but maintain them as useful aliases to their corresponding type. Reviewed-by: Jacopo Mondi Reviewed-by: Barnabás Pőcze Signed-off-by: Kieran Bingham --- v2: - drop fixes tag --- src/apps/cam/camera_session.cpp | 9 +++++++++ src/apps/cam/main.cpp | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index 17444a217bec..5f66eca22ad5 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -97,7 +97,16 @@ CameraSession::CameraSession(CameraManager *cm, std::string orientOpt = options_[OptOrientation].toString(); static const std::map orientations{ { "rot0", libcamera::Orientation::Rotate0 }, + { "rot90", libcamera::Orientation::Rotate90 }, { "rot180", libcamera::Orientation::Rotate180 }, + { "rot270", libcamera::Orientation::Rotate270 }, + + { "rot0mirror", libcamera::Orientation::Rotate0Mirror }, + { "rot90mirror", libcamera::Orientation::Rotate90Mirror }, + { "rot180mirror", libcamera::Orientation::Rotate180Mirror }, + { "rot270mirror", libcamera::Orientation::Rotate270Mirror }, + + /* Helpful aliases */ { "mirror", libcamera::Orientation::Rotate0Mirror }, { "flip", libcamera::Orientation::Rotate180Mirror }, }; diff --git a/src/apps/cam/main.cpp b/src/apps/cam/main.cpp index 17b30fa0e061..54d166884f4d 100644 --- a/src/apps/cam/main.cpp +++ b/src/apps/cam/main.cpp @@ -146,7 +146,10 @@ int CamApp::parseOptions(int argc, char *argv[]) OptCamera); parser.addOption(OptOrientation, OptionString, - "Desired image orientation (rot0, rot180, mirror, flip)", + "Desired image orientation. Supported values:\n" + "- rot0, rot90, rot180, rot270,\n" + "- rot0mirror, rot90mirror, rot180mirror, rot270mirror,\n" + "- mirror (alias for rot0mirror), flip (alias for rot180mirror)", "orientation", ArgumentRequired, "orientation", false, OptCamera); #ifdef HAVE_KMS