diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-02-28 17:45:58 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-03-01 15:45:09 +0200 |
commit | fca7602c3c88e804d1fbb5ae1372e2e6e841a4ee (patch) | |
tree | 8235a7b82e9cb989c07442cea09601f87e251ab7 /include | |
parent | b581b9576abd6cfde9c703b48ba1ab1e48985e6d (diff) |
libcamera: buffer: Add buffer completion status
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/buffer.h | 10 |
1 files changed, 10 insertions, 0 deletions
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<Plane> &planes() { return planes_; } Signal<Buffer *> 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<Plane> planes_; }; |