On Thursday, December 23, 2010 10:27:25 Laurent Pinchart wrote: > Hi Hans, > > On Thursday 23 December 2010 10:20:17 Hans Verkuil wrote: > > On Thursday, December 23, 2010 10:02:33 Laurent Pinchart wrote: > > > On Monday 20 December 2010 14:09:40 Hans Verkuil wrote: > > > > On Monday, December 20, 2010 13:48:51 Laurent Pinchart wrote: > > > > > What if the application wants to change the resolution during capture > > > > > ? It will have to stop capture, call REQBUFS(0), change the format, > > > > > request buffers and restart capture. If filehandle ownership is > > > > > dropped after REQBUFS(0) that will open the door to a race > > > > > condition. > > > > > > > > That's why S_PRIORITY was invented. > > > > > > Right, I should implement that. I think the documentation isn't clear > > > though. What is the background priority for exactly ? > > > > As the documentation mentions, it can be used for background processes > > monitoring VBI (e.g. teletext) transmissions. I'm not aware of any such > > applications, though. > > > > PRIORITY_DEFAULT and PRIORITY_RECORD are the only two relevant prios in > > practice. > > > > > And the "unset" priority ? > > > > Internal prio only. I think it's the value when no file handle is open. > > Aren't priorities associated with file handles ? Yes, but there is also a global prio. > > > Are other applications allowed to change controls when an application has > > > the record priority ? > > > > No. Only read-only ioctls can be executed. > > Then we got an issue here. I want an application to be able to acquire > exclusive streaming rights on the device (so that there won't be race > conditions when changing the resolution), but still allow other applications > to change controls. Why? The whole idea of prios is that once you are PRIO_RECORD no one else can mess with settings. Allowing other apps access to controls will make it possible to e.g. change the contrast to some crappy value. Not acceptable. If the only thing you want to use PRIO_RECORD for in apps is to prevent this 'race condition' (I don't really see this as a real race, to be honest), then the app can raise the prio to RECORD just before STREAMOFF, change the resolution, start streaming again and lower it to the default prio. Regards, Hans > > > In general I find the priority ioctls underspecified, that's why I > > > haven't implemented them yet. > > > > Use the prio support functions in v4l2-common. They are easy to use and do > > the job. > > -- Hans Verkuil - video4linux developer - sponsored by Cisco -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html