From patchwork Thu Oct 23 14:48:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 24754 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 3F479C3342 for ; Thu, 23 Oct 2025 14:50:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B125160858; Thu, 23 Oct 2025 16:50:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="e3CHCrC5"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5E45A60844 for ; Thu, 23 Oct 2025 16:50:08 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:7328:357b:4ce1:72b6]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 2AA05195E; Thu, 23 Oct 2025 16:48:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761230903; bh=rkOkPBkXLjQV0VPKMB8Po4PHfV5o2kMxP1oYCdtChjk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e3CHCrC5fAZyxnz9ZmUzNUSU9Td541xBQagxMZVj93sH06y8KifZmSxt3Ay3Tph3M tp610Y3Ej/B4kL6KJiVaUt8PI5s4P4uVSUs+qkY3CHEq4EGjkPhYrq0jT14O2H0u1I FU2Ya5qDMetAvknG/eQzba+8BDH0qhHzqLJkvros= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug , Kieran Bingham Subject: [PATCH v2 27/35] libcamera: internal: camera_sensor: Add accessor for mountingOrientation_ Date: Thu, 23 Oct 2025 16:48:28 +0200 Message-ID: <20251023144841.403689-28-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20251023144841.403689-1-stefan.klug@ideasonboard.com> References: <20251023144841.403689-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 --- 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;