[libcamera-devel,v6,6/7] libcamera: request: Expose the Stream to Buffers map

Message ID 20190416134210.21097-7-jacopo@jmondi.org
State Superseded
Headers show
Series
  • libcamera: Framework changes to prepare for multiple streams support
Related show

Commit Message

Jacopo Mondi April 16, 2019, 1:42 p.m. UTC
Add to the Request class a method to access the map of Stream to Buffer.

With the introduction of multiple stream support, pipeline handler
should be able to access the map of streams at request queueing time.

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>
---
 include/libcamera/request.h |  1 +
 src/libcamera/request.cpp   | 10 ++++++++++
 2 files changed, 11 insertions(+)

Patch

diff --git a/include/libcamera/request.h b/include/libcamera/request.h
index 0188bcab8383..58de6f00a554 100644
--- a/include/libcamera/request.h
+++ b/include/libcamera/request.h
@@ -32,6 +32,7 @@  public:
 	Request(const Request &) = delete;
 	Request &operator=(const Request &) = delete;
 
+	const std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; }
 	int setBuffers(const std::map<Stream *, Buffer *> &streamMap);
 	Buffer *findBuffer(Stream *stream) const;
 
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 12a3c5204f24..1946845b91f4 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -51,6 +51,16 @@  Request::Request(Camera *camera)
 {
 }
 
+/**
+ * \fn Request::buffers()
+ * \brief Retrieve the request's streams to buffers map
+ *
+ * Return a reference to the map that associates each Stream part of the
+ * request to the Buffer the Stream output should be directed to.
+ *
+ * \return The map of Stream to Buffer
+ */
+
 /**
  * \brief Set the streams to capture with associated buffers
  * \param[in] streamMap The map of streams to buffers