diff options
Diffstat (limited to 'src/qcam')
-rw-r--r-- | src/qcam/main_window.cpp | 29 | ||||
-rw-r--r-- | src/qcam/main_window.h | 1 |
2 files changed, 16 insertions, 14 deletions
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index e0668176..354a5336 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -389,20 +389,7 @@ void MainWindow::requestComplete(Request *request) display(buffer); - request = camera_->createRequest(); - if (!request) { - std::cerr << "Can't create request" << std::endl; - return; - } - - for (auto it = buffers.begin(); it != buffers.end(); ++it) { - Stream *stream = it->first; - FrameBuffer *buffer = it->second; - - request->addBuffer(stream, buffer); - } - - camera_->queueRequest(request); + queueRequest(buffer); } int MainWindow::display(FrameBuffer *buffer) @@ -417,3 +404,17 @@ int MainWindow::display(FrameBuffer *buffer) return 0; } + +void MainWindow::queueRequest(FrameBuffer *buffer) +{ + Request *request = camera_->createRequest(); + if (!request) { + std::cerr << "Can't create request" << std::endl; + return; + } + + Stream *stream = config_->at(0).stream(); + request->addBuffer(stream, buffer); + + camera_->queueRequest(request); +} diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index 40aa10aa..720a3393 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -58,6 +58,7 @@ private: void requestComplete(Request *request); int display(FrameBuffer *buffer); + void queueRequest(FrameBuffer *buffer); QString title_; QTimer titleTimer_; |