diff options
-rw-r--r-- | src/qcam/main_window.cpp | 7 | ||||
-rw-r--r-- | src/qcam/main_window.h | 2 | ||||
-rw-r--r-- | src/qcam/viewfinder.cpp | 6 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index d10c542c..3711a02c 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -524,14 +524,9 @@ void MainWindow::processCapture() queueRequest(buffer); } -int MainWindow::display(FrameBuffer *buffer) +void MainWindow::display(FrameBuffer *buffer) { - if (buffer->planes().size() != 1) - return -EINVAL; - viewfinder_->display(buffer, &mappedBuffers_[buffer]); - - return 0; } void MainWindow::queueRequest(FrameBuffer *buffer) diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index 71206bc9..33522115 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -66,7 +66,7 @@ private: void requestComplete(Request *request); void processCapture(); - int display(FrameBuffer *buffer); + void display(FrameBuffer *buffer); void queueRequest(FrameBuffer *buffer); /* UI elements */ diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp index d00edc33..b8feabd5 100644 --- a/src/qcam/viewfinder.cpp +++ b/src/qcam/viewfinder.cpp @@ -11,6 +11,7 @@ #include <QImageWriter> #include <QMutexLocker> #include <QPainter> +#include <QtDebug> #include "format_converter.h" @@ -27,6 +28,11 @@ ViewFinder::~ViewFinder() void ViewFinder::display(const libcamera::FrameBuffer *buffer, MappedBuffer *map) { + if (buffer->planes().size() != 1) { + qWarning() << "Multi-planar buffers are not supported"; + return; + } + QMutexLocker locker(&mutex_); /* |