At 02:58 PM 5/27/2002 -0400, you wrote:
It seems like VIDIOCSYNC is actually used to return a filled frame to the application's control. Is this correct? -- Michael Poole (It also seems to me that the kernel should indicate which frame it is returning, rather than waiting for a specified frame to be filled and returning it. But I can see arguments for having the application specify the frame, so that is a lesser point.)
You are essentially correct. I started a long thread on this issue a couple months back. What the documentation says is wrong - or at the very least very confusing. There are some here who try to spin it in such a way that it can be construed as correct. What VIDIOCSYNC does is block until the requested frame is available, or return immediately if the frame has already been read.
I don't like the "free" usage here, because what is being done in VIDIOCSYNC (from the application's reference) is "blocking until frame is ready". The only time the "free" context is important is if you want the kernel to finish up with those frames so you can exit your app. Otherwise the context is "request to be filled" and "wait for request to finish".