libcamera: v4l2_videodevice: Avoid extra construction of Framebuffer

While populating the V4L2BufferCache, avoid the extra construction of
FrameBuffer, which is currently done by passing the vector of
FrameBuffer::Planes. It is not wrong per se, but futile to have another
construction of FrameBuffer from a copy of buffer->planes() for the
corresponding Entry.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Umang Jain
2021-07-09 16:54:19 +05:30
parent c73170388e
commit ab09913acb

View File

@@ -183,7 +183,7 @@ V4L2BufferCache::V4L2BufferCache(const std::vector<std::unique_ptr<FrameBuffer>>
for (const std::unique_ptr<FrameBuffer> &buffer : buffers)
cache_.emplace_back(true,
lastUsedCounter_.fetch_add(1, std::memory_order_acq_rel),
buffer->planes());
*buffer.get());
}
V4L2BufferCache::~V4L2BufferCache()