From patchwork Thu Dec 2 14:03:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 14992 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 DB693BF415 for ; Thu, 2 Dec 2021 14:03:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8F62E60862; Thu, 2 Dec 2021 15:03:35 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="AXUwuHgD"; dkim-atps=neutral Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1A0DD605B8 for ; Thu, 2 Dec 2021 15:03:34 +0100 (CET) Received: by mail-pf1-x433.google.com with SMTP id n85so27982700pfd.10 for ; Thu, 02 Dec 2021 06:03:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2McPthkXJ9/lLtflTowN3HeopjV9PW8uYtzgNugHnu8=; b=AXUwuHgD8Mfqs+jXkcBMD97qPt/N9BCQ0QSO7IqzTJgrRpJCvFWnEH/IsHYZqfvLG4 uqpT7cwYEg6o7GrETg8YN7o23HXTRDd3dbHiJI0EN44UYJsyjXQ3dcF/zuRI6rrVfb52 6zKq3s56lA5lJds+sbVJhP3gue39/KHNbPPbE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2McPthkXJ9/lLtflTowN3HeopjV9PW8uYtzgNugHnu8=; b=1olzYpaonjlWOI3vxtgLfFC8GSYaUAtDqxeFxJby8CgaTt3EMLFfdWIfiE4deQNMBk b427GhtL4YA7fAJ0SVklhTHQvamLcgq6izgNZC/IJ1oBqvJyBc7aPg6nFvKrsQHuROkZ oZnB8KcIp92/79c0u2jdiml7xO5BMaEuaAw+36FuhEpjzMOtyW1ek7R8lgB6xFFTOEIL RidyOmjUBCoyCQcFWDRcnRo0yaJkg9L+exl3GKoGd5CihX2usoEDzawFCsIUHhaBEKcy 28FBC/IrIQeFkMzqR3LFckLfHBYuZKL3OmJjKT6jMMbBvNlR1c8IWpi2tplNJK6DWI3X eI6A== X-Gm-Message-State: AOAM533a8r3U5A2C+CZYsiJIDL6uP7NHMfBS8aIXPoZUQuXJPugoFl6q lm6IyllgArEXy6WbFCZhyJQCgY2V4S5M+A== X-Google-Smtp-Source: ABdhPJwasaRNLRu9/L82wW5C6ikqUxfHmYyvBGtCsOW9rgCL1+yTNqQh3JKeTQzykMMqPVMoV3Gu0A== X-Received: by 2002:a65:4cc1:: with SMTP id n1mr9710857pgt.420.1638453812374; Thu, 02 Dec 2021 06:03:32 -0800 (PST) Received: from localhost ([2401:fa00:1:10:9029:d68:4045:e723]) by smtp.gmail.com with UTF8SMTPSA id f2sm3878134pfe.132.2021.12.02.06.03.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Dec 2021 06:03:32 -0800 (PST) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Dec 2021 22:03:16 +0800 Message-Id: <20211202140317.3118364-5-hanlinchen@chromium.org> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog In-Reply-To: <20211202140317.3118364-1-hanlinchen@chromium.org> References: <20211202140317.3118364-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 4/5] libcamera: camera_lens: add CameraLens as a member of CameraSensor 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" Add CameraLens as a member of CameraSenosr. The patch does not implement how to link the lens to the specific sensor yet. Only to provide an interface for pipeline handler's usage. Signed-off-by: Han-Lin Chen Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- include/libcamera/internal/camera_sensor.h | 5 +++++ src/libcamera/camera_sensor.cpp | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index d25a1165..8e97a80e 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -24,6 +24,7 @@ namespace libcamera { class BayerFormat; +class CameraLens; class MediaEntity; class CameraSensor : protected Loggable @@ -60,6 +61,8 @@ public: void updateControlInfo(); + CameraLens *lens() { return lens_.get(); } + protected: std::string logPrefix() const override; @@ -91,6 +94,8 @@ private: const BayerFormat *bayerFormat_; ControlList properties_; + + std::unique_ptr lens_; }; } /* namespace libcamera */ diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 6151b32e..b386e7b0 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -20,6 +20,7 @@ #include #include "libcamera/internal/bayer_format.h" +#include "libcamera/internal/camera_lens.h" #include "libcamera/internal/camera_sensor_properties.h" #include "libcamera/internal/formats.h" #include "libcamera/internal/sysfs.h" @@ -787,6 +788,13 @@ void CameraSensor::updateControlInfo() subdev_->updateControlInfo(); } +/** + * \fn CameraSensor::lens() + * \brief Retrieve the lens controller + * + * \return The lens controller. nullptr if no lens is connected to the sensor + */ + std::string CameraSensor::logPrefix() const { return "'" + entity_->name() + "'";