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 --- include/libcamera/buffer.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/libcamera/buffer.h') diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index dc9aaad1..f740ade9 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -40,12 +40,19 @@ private: class Buffer final { public: + enum Status { + BufferSuccess, + BufferError, + BufferCancelled, + }; + Buffer(); unsigned int index() const { return index_; } unsigned int bytesused() const { return bytesused_; } uint64_t timestamp() const { return timestamp_; } unsigned int sequence() const { return sequence_; } + Status status() const { return status_; } std::vector &planes() { return planes_; } Signal completed; @@ -54,10 +61,13 @@ private: friend class BufferPool; friend class V4L2Device; + void cancel(); + unsigned int index_; unsigned int bytesused_; uint64_t timestamp_; unsigned int sequence_; + Status status_; std::vector planes_; }; -- cgit v1.2.1