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>
This commit is contained in:
Paul Elder 2020-07-08 17:00:41 +09:00
parent e52cc8c916
commit ae50922879

View file

@ -140,7 +140,7 @@ int V4L2Camera::configure(StreamConfiguration *streamConfigOut,
int V4L2Camera::allocBuffers(unsigned int count) int V4L2Camera::allocBuffers(unsigned int count)
{ {
Stream *stream = *camera_->streams().begin(); Stream *stream = config_->at(0).stream();
return bufferAllocator_->allocate(stream); return bufferAllocator_->allocate(stream);
} }
@ -149,13 +149,13 @@ void V4L2Camera::freeBuffers()
{ {
pendingRequests_.clear(); pendingRequests_.clear();
Stream *stream = *camera_->streams().begin(); Stream *stream = config_->at(0).stream();
bufferAllocator_->free(stream); bufferAllocator_->free(stream);
} }
FileDescriptor V4L2Camera::getBufferFd(unsigned int index) 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 = const std::vector<std::unique_ptr<FrameBuffer>> &buffers =
bufferAllocator_->buffers(stream); bufferAllocator_->buffers(stream);