From f3671b33d90cf2bb13ee59ac83822a3294689b22 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 6 Sep 2021 22:09:45 +0300 Subject: qcam: viewfinder: Pass stride value to viewfinder qcam currently assumes that no padding is used at end of lines, and uses the image width as the stride. This leads to rendering failures with some formats on some platforms. To prepare for stride support, add a stride parameter to the ViewFinder::setFormat() function to pass the stride from the stream configuration to the viewfinder. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/qcam/viewfinder_qt.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qcam/viewfinder_qt.h') diff --git a/src/qcam/viewfinder_qt.h b/src/qcam/viewfinder_qt.h index 6b48ef48..756f3fa3 100644 --- a/src/qcam/viewfinder_qt.h +++ b/src/qcam/viewfinder_qt.h @@ -31,7 +31,8 @@ public: const QList &nativeFormats() const override; - int setFormat(const libcamera::PixelFormat &format, const QSize &size) override; + int setFormat(const libcamera::PixelFormat &format, const QSize &size, + unsigned int stride) override; void render(libcamera::FrameBuffer *buffer, Image *image) override; void stop() override; -- cgit v1.2.1