v4l2: v4l2_camera_proxy: Disallow dqbuf when not streaming

Make VIDIOC_DQBUF return -EINVAL if the stream is not turned on.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Paul Elder 2020-06-18 17:25:36 +09:00
parent d45d53cde0
commit b3dc3d7cf2

View file

@ -580,6 +580,9 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg)
if (!hasOwnership(file)) if (!hasOwnership(file))
return -EBUSY; return -EBUSY;
if (!vcam_->isRunning())
return -EINVAL;
if (!validateBufferType(arg->type) || if (!validateBufferType(arg->type) ||
!validateMemoryType(arg->memory)) !validateMemoryType(arg->memory))
return -EINVAL; return -EINVAL;