diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-24 02:44:48 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-25 23:41:33 +0900 |
commit | 0eea47a956cfe6d3db780e974efb904070174b9a (patch) | |
tree | 15f5234ccd1c53d2f7c40b5cc2b530a02df0c28d | |
parent | 9076e88fc3ca3d3ffbd1b0d80542db96708614e7 (diff) |
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>
-rw-r--r-- | src/v4l2/v4l2_camera_proxy.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 3588734a..b23e1f9d 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -359,6 +359,9 @@ int V4L2CameraProxy::vidioc_reqbufs(V4L2CameraFile *file, struct v4l2_requestbuf return 0; } + if (bufferCount_ > 0) + freeBuffers(); + Size size(curV4L2Format_.fmt.pix.width, curV4L2Format_.fmt.pix.height); int ret = vcam_->configure(&streamConfig_, size, v4l2ToDrm(curV4L2Format_.fmt.pix.pixelformat), |