From patchwork Thu Aug 6 13:09:30 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: 9251 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 C0C54BD87A for ; Thu, 6 Aug 2020 13:09:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 96D8D60836; Thu, 6 Aug 2020 15:09:46 +0200 (CEST) Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D73A56038F for ; Thu, 6 Aug 2020 15:09:44 +0200 (CEST) X-Halon-ID: 14e50d00-d7e6-11ea-b48b-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 14e50d00-d7e6-11ea-b48b-0050569116f7; Thu, 06 Aug 2020 15:09:41 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Aug 2020 15:09:30 +0200 Message-Id: <20200806130937.2991606-1-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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, With the recent change where the camera names where remade into a camera id to better model it's original intent it have become necessary to advance the topic of user-friendly names in applications. This series is an attempt to do so. Patch 1/7 adds a new camera property 'Model' that may be used to record a cameras model. Patch 2/7, 3/7 and 4/7 then implements this new property for all pipeline handlers. Patch 5/7 fix a left over bug in the cam utility since the transformation of Camera::name() to Camera::id(). 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 :-) This series depends on [1]. Example of listing cameras with and without this series, Without: $ cam -l Available cameras: 1: \_SB_.PCI0.RP05.PXSX-2.1.1:1.0-0ac8:3420 2: \_SB_.PCI0.RP05.PXSX-2.4:1.0-046d:0843 3: platform/vimc.0 Sensor B $ cam -l Available cameras: 1: \_SB_.PCI0.I2C2.CAM0 2: \_SB_.PCI0.I2C4.CAM1 With: $ cam -l Available cameras: 1: Venus USB2.0 Camera: Venus USB2 with id \_SB_.PCI0.RP05.PXSX-2.1.1:1.0-0ac8:3420 2: Logitech Webcam C930e with id \_SB_.PCI0.RP05.PXSX-2.4:1.0-046d:0843 3: Sensor B facing front rotated 0 degrees with id platform/vimc.0 Sensor B $ cam -l Available cameras: 1: ov13858 facing front rotated 0 degrees with id \_SB_.PCI0.I2C2.CAM0 2: ov5670 facing front rotated 0 degrees with id \_SB_.PCI0.I2C4.CAM1 It can be observed above that all Cameras that report the Location and Rotation properties do so by stating they face the front and are not rotated. 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. 1. [PATCH 0/3] libcamera: Mark controls and property accessors as const operations Niklas Söderlund (7): libcamera: properties: Add model property libcamera: camera_sensor: Set sensor model property libcamera: pipeline: uvcvideo: Initialize CameraData from MediaDevice libcamera: pipeline: uvcvideo: Set sensor model property cam: Rename cameraName variable cam: Print user-friendly camera names qcam: dng_writer: Record camera model src/cam/main.cpp | 47 +++++++++++++++++--- src/libcamera/camera_sensor.cpp | 2 + src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 34 +++++++------- src/libcamera/property_ids.yaml | 5 +++ src/qcam/dng_writer.cpp | 13 ++++-- 5 files changed, 76 insertions(+), 25 deletions(-)