From fca7602c3c88e804d1fbb5ae1372e2e6e841a4ee Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 28 Feb 2019 17:45:58 +0200 Subject: libcamera: buffer: Add buffer completion status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new field to the Buffer class to report its completion status, with a new cancel() method to mark the buffer as cancelled. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- src/libcamera/v4l2_device.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libcamera/v4l2_device.cpp') diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 4c670185..03e4abab 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -799,6 +799,8 @@ Buffer *V4L2Device::dequeueBuffer() buffer->timestamp_ = buf.timestamp.tv_sec * 1000000000ULL + buf.timestamp.tv_usec * 1000ULL; buffer->sequence_ = buf.sequence; + buffer->status_ = buf.flags & V4L2_BUF_FLAG_ERROR + ? Buffer::BufferError : Buffer::BufferSuccess; return buffer; } -- cgit v1.2.1