libcamera: buffer: Add an accessor to the BufferMemory

Buffer instances reference memory, which is modelled internally by a
BufferMemory instance. Store a pointer to the BufferMemory in the Buffer
class, and populate it when the buffer is queued to the camera through a
request. This is useful for applications to access the buffer memory in
the buffer or request completion handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-07-12 22:32:01 +03:00
parent f1199a1011
commit 689e8916ca
8 changed files with 26 additions and 11 deletions
+3
View File
@@ -77,6 +77,7 @@ public:
unsigned int index() const { return index_; }
const std::array<int, 3> &dmabufs() const { return dmabuf_; }
BufferMemory *mem() { return mem_; }
unsigned int bytesused() const { return bytesused_; }
uint64_t timestamp() const { return timestamp_; }
@@ -87,6 +88,7 @@ public:
Stream *stream() const { return stream_; }
private:
friend class Camera;
friend class PipelineHandler;
friend class Request;
friend class Stream;
@@ -98,6 +100,7 @@ private:
unsigned int index_;
std::array<int, 3> dmabuf_;
BufferMemory *mem_;
unsigned int bytesused_;
uint64_t timestamp_;