[libcamera-devel] [PATCH 1/2] libcamera: streams: extend stream configuration with buffer count

Niklas Söderlund niklas.soderlund at ragnatech.se
Mon Feb 4 19:55:20 CET 2019


The camera needs to be configured with the number of buffers to use to
satisfy the application use-case. While it's free for the application to
request any number of buffers the pipeline needs to take the Linux
drivers constraints into consideration.

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 include/libcamera/stream.h | 2 ++
 src/libcamera/stream.cpp   | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h
index 4b24dd841dd64b64..890678360ee87fd7 100644
--- a/include/libcamera/stream.h
+++ b/include/libcamera/stream.h
@@ -17,6 +17,8 @@ struct StreamConfiguration {
 	unsigned int width;
 	unsigned int height;
 	unsigned int pixelFormat;
+
+	unsigned int bufferCount;
 };
 
 } /* namespace libcamera */
diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp
index b0b4efe39c81e747..5ebdce9acdbd3560 100644
--- a/src/libcamera/stream.cpp
+++ b/src/libcamera/stream.cpp
@@ -73,4 +73,9 @@ namespace libcamera {
  * format described in V4L2 using the V4L2_PIX_FMT_* definitions.
  */
 
+/**
+ * \var StreamConfiguration::bufferCount
+ * \brief Number of buffers to allocate for the stream
+ */
+
 } /* namespace libcamera */
-- 
2.20.1



More information about the libcamera-devel mailing list