Hi Matthieu, On Mon, Jan 19, 2009 at 11:02 PM, Matthieu CASTET <matthieu.castet@xxxxxxxxxx> wrote: > Hi, > > I am writing a soc camera driver, and I use sh_mobile_ceu_camera as an > example. > > But I don't understand how buffer are handled when the application is > doing a streamoff : > > streamoff will call videobuf_streamoff and then videobuf_queue_cancel. > videobuf_queue_cancel will call free_buffer. > > But we didn't do stop_capture, so as far I understand the controller is > still writing data in memory. What prevent us to free the buffer we are > writing. I have not looked into this in great detail, but isn't this handled by the videobuf state? The videobuf has state VIDEOBUF_ACTIVE while it is in use. I don't think such a buffer is freed. > Why doesn't we do a stop_capture before videobuf_streamoff ? > > I saw that pxa_camera use videobuf_waiton, before freeing the buffer. > That seem more safe, but that mean we need to wait that controller > finish to write all the pending buffer. Hm, but vivi.c does not use videbuf_waiton(). I guess this depends on how the frames are queued in the driver. Cheers, / magnus -- video4linux-list mailing list Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list