diff options
Diffstat (limited to 'src/qcam/viewfinder_gl.cpp')
-rw-r--r-- | src/qcam/viewfinder_gl.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp index 32232faa..aeb1ea02 100644 --- a/src/qcam/viewfinder_gl.cpp +++ b/src/qcam/viewfinder_gl.cpp @@ -72,7 +72,7 @@ const QList<libcamera::PixelFormat> &ViewFinderGL::nativeFormats() const } int ViewFinderGL::setFormat(const libcamera::PixelFormat &format, - const QSize &size) + const QSize &size, unsigned int stride) { if (format != format_) { /* @@ -92,6 +92,7 @@ int ViewFinderGL::setFormat(const libcamera::PixelFormat &format, } size_ = size; + stride_ = stride; updateGeometry(); return 0; @@ -119,10 +120,6 @@ void ViewFinderGL::render(libcamera::FrameBuffer *buffer, Image *image) renderComplete(buffer_); image_ = image; - /* - * \todo Get the stride from the buffer instead of computing it naively - */ - stride_ = buffer->metadata().planes()[0].bytesused / size_.height(); update(); buffer_ = buffer; } |