[libcamera-devel] [PATCH v5 20/23] v4l2: v4l2_camera: Fix stream selection for buffer operations

Paul Elder paul.elder at ideasonboard.com
Thu Jul 9 15:28:32 CEST 2020


The buffer operations in V4L2Camera were getting the stream from the
wrong place. Fix it.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>

---
No change in v5

New in v4
---
 src/v4l2/v4l2_camera.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
index ffc1230..a923256 100644
--- a/src/v4l2/v4l2_camera.cpp
+++ b/src/v4l2/v4l2_camera.cpp
@@ -140,7 +140,7 @@ int V4L2Camera::configure(StreamConfiguration *streamConfigOut,
 
 int V4L2Camera::allocBuffers(unsigned int count)
 {
-	Stream *stream = *camera_->streams().begin();
+	Stream *stream = config_->at(0).stream();
 
 	return bufferAllocator_->allocate(stream);
 }
@@ -149,13 +149,13 @@ void V4L2Camera::freeBuffers()
 {
 	pendingRequests_.clear();
 
-	Stream *stream = *camera_->streams().begin();
+	Stream *stream = config_->at(0).stream();
 	bufferAllocator_->free(stream);
 }
 
 FileDescriptor V4L2Camera::getBufferFd(unsigned int index)
 {
-	Stream *stream = *camera_->streams().begin();
+	Stream *stream = config_->at(0).stream();
 	const std::vector<std::unique_ptr<FrameBuffer>> &buffers =
 		bufferAllocator_->buffers(stream);
 
-- 
2.27.0



More information about the libcamera-devel mailing list