From patchwork Fri Sep 25 15:07:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9829 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 1A2F9C3B5B for ; Fri, 25 Sep 2020 15:07:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8022D63050; Fri, 25 Sep 2020 17:07:58 +0200 (CEST) Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F87862FD8 for ; Fri, 25 Sep 2020 17:07:56 +0200 (CEST) X-Halon-ID: e1e1e52a-ff40-11ea-a39b-005056917f90 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id e1e1e52a-ff40-11ea-a39b-005056917f90; Fri, 25 Sep 2020 17:07:55 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Fri, 25 Sep 2020 17:07:36 +0200 Message-Id: <20200925150743.1822226-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 0/7] libcamera: Allow for user-friendly names in applications 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, This series trues to advance the topic of user-friendly names in applications. Patch 1/7 adds a new camera property 'Model' that may be used to record a cameras model. Patch 2/7, 3/7, 4/7 and 5/7 then implements this new property for all pipeline handlers. Patch 6/7 introduce user-friendly names to the cam utility. The final patch 7/7 records the model information in the DNG files created by qcam. More work is needed on top of this series to create user-friendly names for qcam. My intention is to do this in a follow up series once this is merged as I fear some bikeshedding on the style of the user-friendly name so lets battle that out in cam first :-) Example of listing cameras with and without this series, Without: $ cam -l Available cameras: 1: \_SB_.PCI0.RP05.PXSX-2.4:1.0-046d:0843 2: platform/vimc.0 Sensor B $ cam -l Available cameras: 1: /base/i2c@ff160000/camera@36 2: /base/i2c@ff160000/camera@3c $ cam -l Available cameras: 1: /base/soc/i2c0mux/i2c@1/imx219@10 $ cam -l Available cameras: 1: \_SB_.PCI0.I2C2.CAM0 2: \_SB_.PCI0.I2C4.CAM1 With: $ cam -l Available cameras: 1: External camera Logitech Webcam C930e (\_SB_.PCI0.RP05.PXSX-2.4:1.0-046d:0843) 2: Internal front camera Sensor B (platform/vimc.0 Sensor B) $ cam -l Available cameras: 1: Internal front camera ov5695 (/base/i2c@ff160000/camera@36) 2: Internal front camera ov2685 (/base/i2c@ff160000/camera@3c) $ cam -l Available cameras: 1: Internal front camera imx219 (/base/soc/i2c0mux/i2c@1/imx219@10) $ cam -l Available cameras: 1: Internal front camera ov13858 (\_SB_.PCI0.I2C2.CAM0) 2: Internal front camera ov5670 (\_SB_.PCI0.I2C4.CAM1) It can be observed above that all Cameras that report the Location property do so by stating they face the front. We know this is not true for some devices. This is however not a fault of this series as it only prints what is reported by the Camera. Once we teach the Camera to report true values for these properties cam will print the correct information. Niklas Söderlund (7): libcamera: properties: Add model property libcamera: utils: Add method to remove non-ASCII characters libcamera: camera_sensor: Set sensor model property libcamera: pipeline: uvcvideo: Initialize CameraData from MediaDevice libcamera: pipeline: uvcvideo: Set sensor model property cam: Print user-friendly camera names qcam: dng_writer: Record camera model include/libcamera/internal/utils.h | 2 ++ src/cam/main.cpp | 31 +++++++++++++++++++- src/libcamera/camera_sensor.cpp | 2 ++ src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 31 ++++++++++---------- src/libcamera/property_ids.yaml | 20 +++++++++++++ src/libcamera/utils.cpp | 17 +++++++++++ src/qcam/dng_writer.cpp | 13 ++++++-- 7 files changed, 97 insertions(+), 19 deletions(-)