]> Pileus Git - ~andy/linux/commitdiff
[media] V4L: soc-camera: start stream after queueing the buffers
authorAnatolij Gustschin <agust@denx.de>
Mon, 31 Jan 2011 12:19:32 +0000 (09:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 21 Mar 2011 23:32:13 +0000 (20:32 -0300)
Some camera systems have strong requirement for capturing
an exact number of frames after starting the stream and do
not tolerate losing captured frames. By starting the stream
after the videobuf has queued the buffers, we ensure that
no frame will be lost.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/soc_camera.c

index a7820a549f1b65a8bed59ef1696eeec6a988176c..67611ad6af962ec3e98325e41815be86be9d4fcf 100644 (file)
@@ -655,10 +655,10 @@ static int soc_camera_streamon(struct file *file, void *priv,
        if (icd->streamer != file)
                return -EBUSY;
 
-       v4l2_subdev_call(sd, video, s_stream, 1);
-
        /* This calls buf_queue from host driver's videobuf_queue_ops */
        ret = videobuf_streamon(&icd->vb_vidq);
+       if (!ret)
+               v4l2_subdev_call(sd, video, s_stream, 1);
 
        return ret;
 }