From 525325440b5047ac94ce96a33e03f233b8b3c59f Mon Sep 17 00:00:00 2001 From: Harvey Yang Date: Mon, 9 Dec 2024 16:34:07 +0000 Subject: [PATCH] V4L2VideoDevice: Call FrameBuffer::Private::cancel() in streamOff() At the moment `V4L2VideoDevice::streamOff()` sets `FrameBuffer::Private`'s metadata directly, while that's equivalent to calling `FrameBuffer::Private::cancel()`. To ease code tracing, this patch replace the manual modification with the function call. Signed-off-by: Harvey Yang Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain Signed-off-by: Kieran Bingham --- src/libcamera/v4l2_videodevice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index d53aa2d3..7822bf1e 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -2031,10 +2031,9 @@ int V4L2VideoDevice::streamOff() /* Send back all queued buffers. */ for (auto it : queuedBuffers_) { FrameBuffer *buffer = it.second; - FrameMetadata &metadata = buffer->_d()->metadata(); cache_->put(it.first); - metadata.status = FrameMetadata::FrameCancelled; + buffer->_d()->cancel(); bufferReady.emit(buffer); }