v4l2: v4l2_camera_proxy: Free old buffers on reqbufs > 0
Free buffers, if any were previously allocated, at VIDIOC_REQBUFS with count > 0. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
9076e88fc3
commit
0eea47a956
1 changed files with 3 additions and 0 deletions
|
@ -359,6 +359,9 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bufferCount_ > 0)
|
||||||
|
freeBuffers();
|
||||||
|
|
||||||
Size size(curV4L2Format_.fmt.pix.width, curV4L2Format_.fmt.pix.height);
|
Size size(curV4L2Format_.fmt.pix.width, curV4L2Format_.fmt.pix.height);
|
||||||
int ret = vcam_->configure(&streamConfig_, size,
|
int ret = vcam_->configure(&streamConfig_, size,
|
||||||
v4l2ToDrm(curV4L2Format_.fmt.pix.pixelformat),
|
v4l2ToDrm(curV4L2Format_.fmt.pix.pixelformat),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue