[libcamera-devel] [PATCH 0/4] libcamera: Collect pixel array properties

Jacopo Mondi jacopo at jmondi.org
Fri Nov 6 16:49:43 CET 2020


This has been floating around for quite some time never really got
to the bottom of it as it required to make V4L2, libcamera and android
properties get along with each other.

To summarize my understanding:

V4L2:
- NATIVE: size of the pixel array matrix (readable and not readable)
- BOUNDS: readable pixels (valid and non valid); defined in respect to NATIVE
- CROP_DEFAULT: active pixels; defined in respect to NATIVE

Libcamera:
- PixelArraySize: Size of the readable area
- PixelArrayActiveAreas: Active areas, defined in respect to PixelArray

PixelArraySize = { BOUNDS.width, BOUNDS.heigh }
PixelArrayActiveAreas = {
	CROP_DEFAULT.x - BOUNDS.x,
	CROP_DEFAULT.y - BOUNDS.y,
	CROP_DEFAULT.width,
	CROP_DEFAULT.height
}

When it comes to map to Android :

android.sensor.info.pixelArraySize = "Dimensions of the full pixel array,
possibly including black calibration pixels"

android.sensor.info.activeArraySize = "The area of the image sensor which
corresponds to active pixels after any geometric distortion correction has been
applied." -> defined in respect to pixelArarySize

pixelArraySize = libcamera::properties::PixelArraySize
activeAreasSize = libcamera::properties::PixelArrayActiveAreas

The first patch on the series adjusts the CameraSensorInfo analog rectangle
to match the V4L2 target definitions, and requires the mainline imx219 driver
to be fixed accordingly, and the in-work ov5647 to complete upstreaming.

As CameraSensorInfo is used by the RaspberryPi IPA, downstream kernel drivers
should be fixed as well.

Currently the sensor drivers for the Soraka device do not support G_SELECTION so
no properties are registered in Android for CrOS on Soraka.

All in all, take this series with a grain of salt, as it will break a few things
if merged :)

Thanks
  j


Jacopo Mondi (4):
  libcamera: camera_sensor: Adjust CameraSensorInfo::analogCrop
  libcamera: camera_sensor: Break out properties initialization
  libcamera: camera_sensor: Initialize PixelArray properties
  android: camera_device: Initialize pixel array properties

 include/libcamera/internal/camera_sensor.h |   1 +
 src/android/camera_device.cpp              |  38 +++++---
 src/libcamera/camera_sensor.cpp            | 102 ++++++++++++++-------
 3 files changed, 99 insertions(+), 42 deletions(-)

--
2.29.1



More information about the libcamera-devel mailing list