diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-04-09 11:27:29 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-04-18 15:37:59 +0200 |
commit | ee027781b4c265b378ed16f91eeded7b42f5dfe4 (patch) | |
tree | 70e4551115ab141c99f0625bf8c98a4cbc967b4f /include | |
parent | 0527ba92adb7d97941ec4b8cd861178634f632b6 (diff) |
libcamera: buffer: Store Request reference in Buffer
Add to the Buffer class methods to set and retrieve a reference to the
Request instance the buffer is part of.
As buffers outlive the Request they are associated with, the reference
is only temporary valid during the buffer completion interval (from when
the buffer gets queued to Camera for processing, until it gets marked as
completed).
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/buffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index 0c844d12..8f9b42e3 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -13,6 +13,7 @@ namespace libcamera { class BufferPool; +class Request; class Plane final { @@ -52,14 +53,18 @@ public: unsigned int sequence() const { return sequence_; } Status status() const { return status_; } std::vector<Plane> &planes() { return planes_; } + Request *request() const { return request_; } private: friend class BufferPool; friend class PipelineHandler; + friend class Request; friend class V4L2Device; void cancel(); + void setRequest(Request *request) { request_ = request; } + unsigned int index_; unsigned int bytesused_; uint64_t timestamp_; @@ -67,6 +72,7 @@ private: Status status_; std::vector<Plane> planes_; + Request *request_; }; class BufferPool final |