From 5704856681a0e9fc5eba7dd4af7f153a05e3db1a Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 25 Mar 2022 09:09:02 +0000 Subject: libcamera: v4l2_videodevice: Empty the V4L2 buffer cache on streamOff() When streamOff() is called, ensure the cache entries for the remaining queued buffers are freed since this will not happen via the dequeueBuffer() mechanism. Additionally, add a V4L2BufferCache::isEmpty() function and assert that the cache is empty at the end of the streamOff() call. Signed-off-by: Naushir Patuck Tested-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- include/libcamera/internal/v4l2_videodevice.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/libcamera/internal/v4l2_videodevice.h') diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h index d7a81e08..cfeae7bd 100644 --- a/include/libcamera/internal/v4l2_videodevice.h +++ b/include/libcamera/internal/v4l2_videodevice.h @@ -124,6 +124,7 @@ public: V4L2BufferCache(const std::vector> &buffers); ~V4L2BufferCache(); + bool isEmpty() const; int get(const FrameBuffer &buffer); void put(unsigned int index); -- cgit v1.2.1