[libcamera-devel,13/27] libcamera: stream: Construct a stream

Message ID 20190206060818.13907-14-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Capture frames throught requests
Related show

Commit Message

Laurent Pinchart Feb. 6, 2019, 6:08 a.m. UTC
From: Kieran Bingham <kieran.bingham@ideasonboard.com>

Construct a stream object with a default internal pool.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 include/libcamera/stream.h |  8 ++++++++
 src/libcamera/stream.cpp   | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+)

Patch

diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index 890678360ee8..111f2c933efa 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -7,10 +7,18 @@ 
 #ifndef __LIBCAMERA_STREAM_H__
 #define __LIBCAMERA_STREAM_H__
 
+#include <libcamera/buffer.h>
+
 namespace libcamera {
 
 class Stream final
 {
+public:
+	Stream();
+	BufferPool &bufferPool() { return bufferPool_; }
+
+private:
+	BufferPool bufferPool_;
 };
 
 struct StreamConfiguration {
diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
index dd9092d958d9..b6238946a8d5 100644
--- a/src/libcamera/stream.cpp
+++ b/src/libcamera/stream.cpp
@@ -47,6 +47,24 @@  namespace libcamera {
  * optimal stream for the task.
  */
 
+/**
+ * \brief Construct a stream with default parameters
+ */
+Stream::Stream()
+{
+}
+
+/**
+ * \fn Stream::bufferPool()
+ * \brief Retrieve the buffer pool for the stream
+ *
+ * The buffer pool handles the buffers used to capture frames at the output of
+ * the stream. It is initially created empty and shall be populated with
+ * buffers before being used.
+ *
+ * \return A reference to the buffer pool
+ */
+
 /**
  * \struct StreamConfiguration
  * \brief Configuration parameters for a stream