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:
Laurent Pinchart
2025-09-08 20:40:18 +02:00
parent 5e351b89f0
commit b8d332cdcc
12 changed files with 38 additions and 20 deletions
+4 -1
View File
@@ -363,8 +363,11 @@ int PipelineHandlerVimc::start(Camera *camera, [[maybe_unused]] const ControlLis
/* Map the mock IPA buffers to VIMC IPA to exercise IPC code paths. */
std::vector<IPABuffer> ipaBuffers;
for (auto [i, buffer] : utils::enumerate(data->mockIPABufs_)) {
Span<const FrameBuffer::Plane> planes = buffer->planes();
buffer->setCookie(i + 1);
ipaBuffers.emplace_back(buffer->cookie(), buffer->planes());
ipaBuffers.emplace_back(buffer->cookie(),
std::vector<FrameBuffer::Plane>{ planes.begin(), planes.end() });
}
data->ipa_->mapBuffers(ipaBuffers);