From patchwork Fri Apr 30 17:38:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 12156 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 BD9C7BDE4F for ; Fri, 30 Apr 2021 17:37:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DBF4E68911; Fri, 30 Apr 2021 19:37:27 +0200 (CEST) Received: from relay12.mail.gandi.net (relay12.mail.gandi.net [217.70.178.232]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 203F4688A5 for ; Fri, 30 Apr 2021 19:37:26 +0200 (CEST) Received: from uno.LocalDomain (93-61-96-190.ip145.fastwebnet.it [93.61.96.190]) (Authenticated sender: jacopo@jmondi.org) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 8ED4A200006; Fri, 30 Apr 2021 17:37:25 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Apr 2021 19:38:00 +0200 Message-Id: <20210430173803.198220-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 0/3] Introduce CameraSensorProperties database 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" Hello, reworked [1/3] to address Laurent's comments - Drop SensorDatabase class and move the static get() method to CameraSensorProperties - Remove the macro and initialize the CameraSensorProperties map in-place - Drop tags as the patch has changed I had to declare CameraSensorProperties as struct as otherwise initializing the map with an initializer list gives me: ../src/libcamera/camera_sensor_properties.cpp:58:2: error: could not convert ‘{{"imx219", }, {"ov5670", }, {"ov13858", }}’ from ‘’ to ‘const std::map, const libcamera::CameraSensorProperties>’ This could probably be closed by adding a constructor to the CameraSensorProperties class. I fear that this won't scale well, as for any new parameter added to the class we'll need to add an element to the constructor and this could get ugly quite quickly. Hence, declare CameraSensorProperties as a struct and allow named member initilization. Thanks j Jacopo Mondi (3): libcamera: Introduce camera sensor properties libcamera: camera_sensor: Register static properties android: camera_device: Report sensor physical size include/libcamera/internal/camera_sensor.h | 1 + .../internal/camera_sensor_properties.h | 24 +++++++ include/libcamera/internal/meson.build | 1 + src/android/camera_device.cpp | 30 ++++---- src/libcamera/camera_sensor.cpp | 16 ++++- src/libcamera/camera_sensor_properties.cpp | 71 +++++++++++++++++++ src/libcamera/meson.build | 1 + 7 files changed, 129 insertions(+), 15 deletions(-) create mode 100644 include/libcamera/internal/camera_sensor_properties.h create mode 100644 src/libcamera/camera_sensor_properties.cpp --- 2.31.1