From patchwork Fri Dec 3 09:44:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanlin Chen X-Patchwork-Id: 15006 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 D7B29BDB13 for ; Fri, 3 Dec 2021 09:44:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 93C8760832; Fri, 3 Dec 2021 10:44:42 +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="Qza/PZoc"; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 25204607DE for ; Fri, 3 Dec 2021 10:44:41 +0100 (CET) Received: by mail-pl1-x636.google.com with SMTP id b13so1732809plg.2 for ; Fri, 03 Dec 2021 01:44:41 -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=91+Ee9OsrtZPeC0t7KdR7vuUzPXFmVUxQdvdEkxOXGk=; b=Qza/PZocqcKFTpyh1xrbaCq25g8q9oT65ClGhdUCSJuSssgconsSHU+nt9CHknB09X WJbLWnSKiH0NaoqkJtVkt10L5ACfF4bFJdWpPHTXRNUGOna0SyRIDy4GIB2bjvBktM07 F4yMTXkWJrih6PAb0BHaH/J0Nip4AaC3rlu+I= 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=91+Ee9OsrtZPeC0t7KdR7vuUzPXFmVUxQdvdEkxOXGk=; b=whYNb1QRydQL1FSN1kYlDm6yCdSJJf5tFOLN2KZ+NSO9TXUiOoOpocuXe13TDz41XY N9EOSR86GuC+Eg980HJvYsYV7E7EJSEGcokqj9BkL06NCN4FgBIo8OZxkN+sfhzduwI6 ze+xkZLpuyJZW5M76GL/zO1+mSQuN6I5mMWePIptLrx2b/v8HQkINOzRwxMmE4SBEHUr Xt5REqmEJYjXQguJrodssnDHW/EYQ/Z8kDTbvv1o4DVLe/034YajufmxkYE80xX8emiY coyEZZISpYdwnBouOWDUk4mfG01Iqgk/X3VMzXkDd9k/9XFA4o+kAUHjQoU+6/p4S2+/ xiLw== X-Gm-Message-State: AOAM532Rv2Jqz4cRvTgN4xxhxq7LANWVg7Yy4iSRQOy/Udk89FISeNT2 YuZ4+nzJ72ikFCJEev5djyW7VNvXG9Bezg== X-Google-Smtp-Source: ABdhPJxC9699c1ZArpgV9JsOsxrxF7I5D81BPXdUofNiFU0++FYCNlbVzlQRf+Rm8klWVIRpF06YhA== X-Received: by 2002:a17:90a:df14:: with SMTP id gp20mr12803284pjb.186.1638524679606; Fri, 03 Dec 2021 01:44:39 -0800 (PST) Received: from localhost ([2401:fa00:1:10:110e:45d1:2f92:6647]) by smtp.gmail.com with UTF8SMTPSA id s8sm2474535pfe.196.2021.12.03.01.44.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Dec 2021 01:44:39 -0800 (PST) From: Han-Lin Chen To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Dec 2021 17:44:25 +0800 Message-Id: <20211203094426.101454-5-hanlinchen@chromium.org> X-Mailer: git-send-email 2.34.0.384.gca35af8252-goog In-Reply-To: <20211203094426.101454-1-hanlinchen@chromium.org> References: <20211203094426.101454-1-hanlinchen@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v8 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 CameraSensor. 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 | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 2facbf3c..788c2fa3 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 *focusLens() { return focusLens_.get(); } + protected: std::string logPrefix() const override; @@ -91,6 +94,8 @@ private: const BayerFormat *bayerFormat_; ControlList properties_; + + std::unique_ptr focusLens_; }; } /* namespace libcamera */ diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 6151b32e..c89d39e1 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,14 @@ void CameraSensor::updateControlInfo() subdev_->updateControlInfo(); } +/** + * \fn CameraSensor::focusLens_() + * \brief Retrieve the focus lens controller + * + * \return The focus lens controller. nullptr if no focus lens controller is + * connected to the sensor + */ + std::string CameraSensor::logPrefix() const { return "'" + entity_->name() + "'";