From patchwork Tue Nov 25 16:28:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 25200 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 0204EC333C for ; Tue, 25 Nov 2025 16:29:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B715A60AA9; Tue, 25 Nov 2025 17:29:59 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RbZ0nz3r"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0585E60AA0 for ; Tue, 25 Nov 2025 17:29:57 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:bae1:340c:573c:570b]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 11EB218CB; Tue, 25 Nov 2025 17:27:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1764088068; bh=ixG83Iqpe2OIzb2G9wcrpsacCxtaL9lyfr55i2vN5vw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RbZ0nz3ri+u81sgpb/+VxGHPvrb+NeJx0K2GfwC+W+i9mcsb2cuMbEW5UhB54Ltff pfo6LgvAsPeCLc4BQif+KuUytH3WNIEeqrLjd77KaZjT9Z8m8KgD8ebFXePG3XB+Y1 oHliuWcekwZH0qh7cPXakJW2lPMT7H8HnVxTlR10= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham , Paul Elder Subject: [PATCH v3 21/29] libcamera: internal: camera_sensor: Add accessor for mountingOrientation_ Date: Tue, 25 Nov 2025 17:28:33 +0100 Message-ID: <20251125162851.2301793-22-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251125162851.2301793-1-stefan.klug@ideasonboard.com> References: <20251125162851.2301793-1-stefan.klug@ideasonboard.com> 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" To properly handle the orientation in the dewarper, the mounting orientation of the sensor needs to be queryable. Add that. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- Changes in v3: - Collected tag Changes in v2: - Collected tag - Add documentation --- include/libcamera/internal/camera_sensor.h | 1 + src/libcamera/sensor/camera_sensor.cpp | 7 +++++++ src/libcamera/sensor/camera_sensor_legacy.cpp | 1 + src/libcamera/sensor/camera_sensor_raw.cpp | 1 + 4 files changed, 10 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index f6ef4df170d4..e6b72d22ac21 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -73,6 +73,7 @@ public: virtual int sensorInfo(IPACameraSensorInfo *info) const = 0; virtual Transform computeTransform(Orientation *orientation) const = 0; virtual BayerFormat::Order bayerOrder(Transform t) const = 0; + virtual Orientation mountingOrientation() const = 0; virtual const ControlInfoMap &controls() const = 0; virtual ControlList getControls(Span ids) = 0; diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp index 4f2fd2690eb5..05390d1e1b60 100644 --- a/src/libcamera/sensor/camera_sensor.cpp +++ b/src/libcamera/sensor/camera_sensor.cpp @@ -331,6 +331,13 @@ int CameraSensor::setEmbeddedDataEnabled(bool enable) * \return The Bayer order produced by the sensor when the Transform is applied */ +/** + * \fn CameraSensor::mountingOrientation() + * \brief Fetch the mounting orientation of the sensor + * + * \return The mounting orientation of the sensor + */ + /** * \fn CameraSensor::controls() * \brief Retrieve the supported V4L2 controls and their information diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp index f9e685a9acc4..39c34200b0ff 100644 --- a/src/libcamera/sensor/camera_sensor_legacy.cpp +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp @@ -88,6 +88,7 @@ public: int sensorInfo(IPACameraSensorInfo *info) const override; Transform computeTransform(Orientation *orientation) const override; BayerFormat::Order bayerOrder(Transform t) const override; + Orientation mountingOrientation() const override { return mountingOrientation_; } const ControlInfoMap &controls() const override; ControlList getControls(Span ids) override; diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp index 8ea4423698cd..759cccafe4a9 100644 --- a/src/libcamera/sensor/camera_sensor_raw.cpp +++ b/src/libcamera/sensor/camera_sensor_raw.cpp @@ -94,6 +94,7 @@ public: int sensorInfo(IPACameraSensorInfo *info) const override; Transform computeTransform(Orientation *orientation) const override; BayerFormat::Order bayerOrder(Transform t) const override; + Orientation mountingOrientation() const override { return mountingOrientation_; } const ControlInfoMap &controls() const override; ControlList getControls(Span ids) override;