mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
libcamera: rpi: Allow platformValidate() to adjust format strides
Propagate any changes to the format stride done by platformValidate(). The stride value may be adjusted for performace reasons. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
40d50263f5
commit
3caaafafa8
1 changed files with 11 additions and 0 deletions
|
@ -309,6 +309,17 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
|
|||
V4L2DeviceFormat format;
|
||||
format.fourcc = out.dev->toV4L2PixelFormat(cfg.pixelFormat);
|
||||
format.size = cfg.size;
|
||||
|
||||
/*
|
||||
* platformValidate may have worked out the correct stride so we
|
||||
* must pass it in. This also needs the planesCount to be set
|
||||
* correctly or the stride will be ignored.
|
||||
*/
|
||||
const PixelFormat &pixFormat = format.fourcc.toPixelFormat();
|
||||
const PixelFormatInfo &info = PixelFormatInfo::info(pixFormat);
|
||||
format.planesCount = info.numPlanes();
|
||||
format.planes[0].bpl = cfg.stride;
|
||||
|
||||
/* We want to send the associated YCbCr info through to the driver. */
|
||||
format.colorSpace = yuvColorSpace_;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue