From 6deb9c513c67f9c8ba85d05198bedccc7b716f16 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Fri, 8 Mar 2024 07:30:59 +0000 Subject: [PATCH] libcamera: fix bytesperline calculation for libcamera0.2 (#140) For libcamera0.2 configuraiton.stride is already set to some incorrect value and configurations->validate() doesn't update it if it's not 0. For libcamera0.1 it was set to 0. So set it to 0 manually to make sure configurations->validate() computes the correct value. --- device/libcamera/buffer_list.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/device/libcamera/buffer_list.cc b/device/libcamera/buffer_list.cc index 05dfee1..d885a19 100644 --- a/device/libcamera/buffer_list.cc +++ b/device/libcamera/buffer_list.cc @@ -92,6 +92,8 @@ int libcamera_buffer_list_open(buffer_list_t *buf_list) } if (buf_list->fmt.bytesperline > 0) { configuration.stride = buf_list->fmt.bytesperline; + } else { + configuration.stride = 0; } if (buf_list->fmt.nbufs > 0) { configuration.bufferCount = buf_list->fmt.nbufs;