From 5085bc03bc14234bced8b194f4ed61f221d81852 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 12 Jul 2019 15:15:48 +0300 Subject: libcamera: Stop using Stream::bufferPool to get the number of buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cam and qcam applications, as well as the camera capture test case, access the Stream::bufferPool in order to know how many requests to initially queue. As part of an effort to remove access to the buffer pool from applications, use the buffer count from the stream configuration instead. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/cam/capture.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/cam') 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 -- cgit v1.2.1