libcamera: v4l2_videodevice: Cache PixelFormatInfo

Cache the PixelFormatInfo instead of looking it up in every call to
createBuffer(). This prepares for usage of the info in queueBuffer(), to
avoid a looking every time a buffer is queued.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
Laurent Pinchart 2021-09-01 21:00:24 +03:00
parent 81a38f4373
commit 6d98fe5b68
2 changed files with 21 additions and 8 deletions

View file

@ -241,6 +241,7 @@ private:
V4L2Capability caps_;
V4L2DeviceFormat format_;
const PixelFormatInfo *formatInfo_;
enum v4l2_buf_type bufferType_;
enum v4l2_memory memoryType_;