From ab09913acbb0c00a74ff6498fa9b52f8d74548fa Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Fri, 9 Jul 2021 16:54:19 +0530 Subject: 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/v4l2_videodevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 3d2d99b4..da2af6a1 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -183,7 +183,7 @@ V4L2BufferCache::V4L2BufferCache(const std::vector> for (const std::unique_ptr &buffer : buffers) cache_.emplace_back(true, lastUsedCounter_.fetch_add(1, std::memory_order_acq_rel), - buffer->planes()); + *buffer.get()); } V4L2BufferCache::~V4L2BufferCache() -- cgit v1.2.1