summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-12 22:32:01 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-14 16:01:07 +0300
commit689e8916caf11942286a1f1264e55dcb709d3939 (patch)
treea82d5d6e858c2a0e3cd1b939198fa87ba5efa3f2 /include
parentf1199a1011a22f00e863473ae241c781f4bd999d (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/libcamera/buffer.h3
1 files changed, 3 insertions, 0 deletions
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<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_;