[libcamera-devel] [PATCH v3 03/10] libcamera: properties: Generate libcamera properties

Jacopo Mondi jacopo at jmondi.org
Fri Jan 3 11:45:30 CET 2020


Hello,
    following discussions on the 'rotation' property here defined, it
seems we're struggling to find consensus on its definition.

What I had here come from the kernel definition, and poorly applies to
a camera library control.

I'll here have another go, trying to list the possible use cases as
suggested by Laurent, in the attempt to latr find a generic enough
definition.

With this clarified, I'll re-send the series (almost fully reviewed)
along with compound controls support on top.

On Mon, Dec 09, 2019 at 05:34:39PM +0100, Jacopo Mondi wrote:
> Re-use the Control generation infrastructure to generate libcamera properties.
>
> Introduce three additional files:
> - include/libcamera/property_ids.h
>   Defines the properties ids
>
> - src/libcamera/property_ids.cpp
>   Defines the properties Control<> instances
>
> - src/libcamera/property_ids.yaml
>   Provide properties definitions
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---

[snip]

> +
> +  - Rotation:
> +      type: int32_t
> +      description: |
> +        Camera mounting rotation expressed as counterclockwise rotation degrees
> +        towards the axis perpendicular to the sensor surface and directed away
> +        from it


This comes straight from the DT property I am trying to push to kernel
space, but for libcamera it might be more opportune to define rotation
as the -correction- to apply to the captured images to obtain the best
possible orientation for the device the camera module is installed on.

I think what we're missing here is a definition of best possible
orientation that is generic and clear enough.

I'll try to list a few use cases
- phone/tablet
  Images should be presented to the user with their longer side
  aligned to the device's longer side, to minimize resizing/cropping.
- laptop (user facing camera)
  Images should be presented with the longer side parallel to the
  usage surface
- sport/action cameras
  The FOV should be maximed in its horizontal dimension

So it seems to me each use case has a different 'designated
orientation' and the rotation correction really depends on the device
intended usage. This rises the question, who sets this property ?
We're moving this to a CameraSensor subclass, while it really seems to
me this is -device- dependent (and yes, calls for a config file, I'm
sorry).

So I would go with:
"Rotation correction, expressed as counterclockwise rotation degrees
to apply to captured images to align their display orientation with
the device intended usage orientation. For mobile devices such as
phones or tablets, images are usually displayed with their longer side
aligned to the device longer edge."

How would that feel ?
Please note also the DT property and the proposed v4l2 control would
need some feedbacks, as ideally, the two series should go in more or
less at the same time.

Thanks
   j
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20200103/4446ac5e/attachment.sig>


More information about the libcamera-devel mailing list