Commit 9776e171 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] stk-webcam: implement support for count == 0 when calling REQBUFS

The spec specifies that setting count to 0 in v4l2_requestbuffers
should result in releasing any streaming resources and the stream
ownership. Implement this.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Tested-by: default avatarArvydas Sidorenko <asido4@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f81e372a
...@@ -1046,6 +1046,13 @@ static int stk_vidioc_reqbufs(struct file *filp, ...@@ -1046,6 +1046,13 @@ static int stk_vidioc_reqbufs(struct file *filp,
if (is_streaming(dev) if (is_streaming(dev)
|| (dev->owner && dev->owner != filp)) || (dev->owner && dev->owner != filp))
return -EBUSY; return -EBUSY;
stk_free_buffers(dev);
if (rb->count == 0) {
stk_camera_write_reg(dev, 0x0, 0x49); /* turn off the LED */
unset_initialised(dev);
dev->owner = NULL;
return 0;
}
dev->owner = filp; dev->owner = filp;
/*FIXME If they ask for zero, we must stop streaming and free */ /*FIXME If they ask for zero, we must stop streaming and free */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment