Re: v4l2 api

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Gerd Knorr wrote:

The major changes we are thinking about are:

* open() handling.

  The recent changes in videodev.c provide a sane way for drivers to
  support multiple opens.  This allows to take a completely different
  approach for using the different functions of a video card:  Instead
  of having multiple devices (video, vbi, ...) there is only one which
  can be opened multiple times and switched to different modes.
Are you still planning to support non-capturing opens explicitly? E.g., the app clears the V4L2_CAP_VIDEO_CAPTURE flag via some ioctl()?

Right now it's easy to write a driver that can support unlimited non-capturing opens, but only one capturing open at a time. All you need is "if (flags | O_NONCAP) return -EINVAL;" at the appropriate points and a small check in open().

With the new API, it looks like the driver will need checks all over the place in ioctl() read(), etc... to make sure that two apps don't try to capture at the same time. In other words, you have to do mutual exclusion at capture time based on the app's actions, instead of at open() time based on the app's stated intention. IMHO if a driver doesn't support multiple simultaneous captures it should let the app know at open() time by returning -EBUSY.

--
Mark McClelland
mark@xxxxxxxxxxxxxxxx






[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux