libcamera: camera_sensor: Apply flips at setFormat()

Augment the CameraSensor::setFormat() function to configure horizontal
and vertical flips before applying the image format on the sensor.

Applying flips before format is crucial as they might change the Bayer
pattern ordering.

To allow users of the CameraSensor class to specify a Transform,
add to the V4L2SubdeviceFormat class a 'transform' member, by
default initialized to Transform::Identity.

Moving the handling of H/V flips to the CameraSensor class allows to
remove quite some boilerplate code from the IPU3 and RaspberryPi
pipeline handlers.

No functional changes intended.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
This commit is contained in:
Jacopo Mondi
2022-11-24 10:33:06 +01:00
parent 1a614866a2
commit 6f6e1bf704
7 changed files with 49 additions and 48 deletions

View File

@@ -216,6 +216,13 @@ const std::map<uint32_t, V4L2SubdeviceFormatInfo> formatInfoMap = {
* resulting color space is acceptable.
*/
/**
* \var V4L2SubdeviceFormat::transform
* \brief The transform (vertical/horizontal flips) to be applied on the subdev
*
* Default initialized to Identity (no transform).
*/
/**
* \brief Assemble and return a string describing the format
* \return A string describing the V4L2SubdeviceFormat