diff options
-rw-r--r-- | src/cam/capture.cpp | 6 | ||||
-rw-r--r-- | src/qcam/main_window.cpp | 3 | ||||
-rw-r--r-- | test/camera/capture.cpp | 3 |
3 files changed, 4 insertions, 8 deletions
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp index 1cf59063..66ec1aba 100644 --- a/src/cam/capture.cpp +++ b/src/cam/capture.cpp @@ -74,10 +74,8 @@ int Capture::capture(EventLoop *loop) /* Identify the stream with the least number of buffers. */ unsigned int nbuffers = UINT_MAX; - for (StreamConfiguration &cfg : *config_) { - Stream *stream = cfg.stream(); - nbuffers = std::min(nbuffers, stream->bufferPool().count()); - } + for (StreamConfiguration &cfg : *config_) + nbuffers = std::min(nbuffers, cfg.bufferCount); /* * TODO: make cam tool smarter to support still capture by for diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 6ecf30e3..7023e115 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -140,9 +140,8 @@ int MainWindow::startCapture() return ret; } - BufferPool &pool = stream->bufferPool(); std::vector<Request *> requests; - for (unsigned int i = 0; i < pool.count(); ++i) { + for (unsigned int i = 0; i < cfg.bufferCount; ++i) { Request *request = camera_->createRequest(); if (!request) { std::cerr << "Can't create request" << std::endl; diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index ff1cbd6c..e6bf7a8d 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -80,9 +80,8 @@ protected: } Stream *stream = cfg.stream(); - BufferPool &pool = stream->bufferPool(); std::vector<Request *> requests; - for (unsigned int i = 0; i < pool.count(); ++i) { + for (unsigned int i = 0; i < cfg.bufferCount; ++i) { Request *request = camera_->createRequest(); if (!request) { cout << "Failed to create request" << endl; |