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

Jacopo Mondi jacopo at jmondi.org
Wed Dec 2 14:53:50 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 imx219 driver
to be fixed accordingly:
RPi downstream: https://github.com/raspberrypi/linux/pull/3983
Linux mainline (should land in v5.11)
https://patchwork.linuxtv.org/project/linux-media/patch/20200805105721.15445-5-jacopo@jmondi.org/

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

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              |  33 +++++--
 src/libcamera/camera_sensor.cpp            | 104 ++++++++++++++-------
 3 files changed, 95 insertions(+), 43 deletions(-)

-- 
2.29.1



More information about the libcamera-devel mailing list