summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-07-08 17:00:41 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-07-10 16:11:44 +0900
commitae50922879a817c2e215fb144e6083a7702dec7e (patch)
tree42553466d67e4da19ac2d461cf1435ec1700ba54
parente52cc8c916a61e0e09cbdd9002b9a90cfcc4f611 (diff)
v4l2: v4l2_camera: Fix stream selection for buffer operations
The buffer operations in V4L2Camera were getting the stream from the wrong place. Fix it. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/v4l2/v4l2_camera.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp
index ffc1230e..a923256a 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);