From 689e8916caf11942286a1f1264e55dcb709d3939 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 12 Jul 2019 22:32:01 +0300 Subject: libcamera: buffer: Add an accessor to the BufferMemory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Niklas Söderlund --- include/libcamera/buffer.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h index f8569a6b..fc5c7d4c 100644 --- a/include/libcamera/buffer.h +++ b/include/libcamera/buffer.h @@ -77,6 +77,7 @@ public: unsigned int index() const { return index_; } const std::array &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 dmabuf_; + BufferMemory *mem_; unsigned int bytesused_; uint64_t timestamp_; -- cgit v1.2.1