libcamera: framebuffer: Replace vector with span in constructor
The FrameBuffer constructor takes a list of planes as an std::vector. The caller may stores the planes in a different type of container, resulting in the needless allocation of a temporary vector. Replace it with a span. Suggested-by: Daniel Rákos <daniel.rakos@rastergrid.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
@@ -1031,9 +1031,12 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera)
|
||||
auto pushBuffers = [&](const std::vector<std::unique_ptr<FrameBuffer>> &buffers,
|
||||
std::queue<FrameBuffer *> &queue) {
|
||||
for (const std::unique_ptr<FrameBuffer> &buffer : buffers) {
|
||||
Span<const FrameBuffer::Plane> planes = buffer->planes();
|
||||
|
||||
buffer->setCookie(ipaBufferId++);
|
||||
data->ipaBuffers_.emplace_back(buffer->cookie(),
|
||||
buffer->planes());
|
||||
std::vector<FrameBuffer::Plane>{ planes.begin(),
|
||||
planes.end() });
|
||||
queue.push(buffer.get());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user