[libcamera-devel] [PATCH v3 0/7] libcamera: Allow for user-friendly names in applications

Niklas Söderlund niklas.soderlund at ragnatech.se
Thu Aug 13 11:57:19 CEST 2020


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, 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 :-)

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 (\_SB_.PCI0.RP05.PXSX-2.1.1:1.0-0ac8:3420)
    2: Logitech Webcam C930e (\_SB_.PCI0.RP05.PXSX-2.4:1.0-046d:0843)
    3: Internal front camera (platform/vimc.0 Sensor B)

    $ cam -l
    Available cameras:
    1: Internal front camera (\_SB_.PCI0.I2C2.CAM0)
    2: Internal front camera (\_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.

1. [PATCH 0/3] libcamera: Mark controls and property accessors as const
   operations

Niklas Söderlund (7):
  libcamera: properties: Add model property
  libcamera: utils: Add method to strip Unicode 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                             | 33 ++++++++++++++++++-
 src/libcamera/camera_sensor.cpp              |  2 ++
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 34 +++++++++++---------
 src/libcamera/property_ids.yaml              |  7 ++++
 src/libcamera/utils.cpp                      | 21 ++++++++++++
 src/qcam/dng_writer.cpp                      | 13 ++++++--
 7 files changed, 93 insertions(+), 19 deletions(-)

-- 
2.28.0



More information about the libcamera-devel mailing list