Michael Hunold wrote:
> Gerd Knorr wrote:
> > The v4l2 interface isn't perfect either.  IMHO the multiple open spec
> > has some problems too, because you have to specify at open() time if
> > you want to capture with that file handle or not, and only one handle
> > is allowed to ask for capture.  I'd like to see this limit removed.
> >
> > It should be handled this way:
> > [many opens on a device, each can get frames by read(), but only one
> >  (typically) can REQBUFS and stream, locking out the others]
> [...]
> 
> Ok, good suggestion. In my eyes this should be incorporated into
> v4l2. Bill, what do you think?

I thought of this when designing V4L2. In fact, this is exactly how
Winnov's Windows drivers work! I rejected it because I judged it too
complicated for driver writers and too different from what existed.

One of the V4L2 design criteria was to keep it as simple as possible for
driver writers while still accomplishing the essential goals. Remember
there were obviously zero V4L2 drivers at the time, and for the effort
to be useful people must be attracted to and successful at driver
creation, as much as possible.

I've done what you're discussing before, and to do it right alot of what
you think of as per-device state becomes per-open state, including
capture format, input mux selection and more. When an app requests a
frame, the whole device state for that open has to be essentially
context-switched onto the device and the frame captured. You are
creating multiple virtual devices and task switching. Would everybody
understand that? Would they get it right?

My perception was that the Linux Way was for drivers to be thin layers
over the hardware, not with all that abstraction. Ioctls were meant to
set a few registers and that was that. I think that's too simple for a
video API. I tried to strike balances among abstraction, function,
flexibility, implementation, and culture.

I never thought of a device that can capture multiple streams from
different inputs, though.

Anyway, that's why V4L2 is the way it is. Still want to change it?

Bill.


-- 
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to