[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-video
Subject:    Re: [video4linux] multiple opens/VfW
From:       Bill Dirks <dirks () rendition ! com>
Date:       1998-07-29 5:26:58
[Download RAW message or body]

Alex Bakaev wrote:
> my driver didn't permit multiple opens on the same channel.

Wimp! :-P

> So I was talking about different channels when I said multiple opens.
> What does it mean to open VIDEOIN twice?

You have two capture contexts. Two virtual devices. You can call
DVM_FORMAT on each one and they're independent. The open handle is
really a pointer to a structure that contains all the state for that
context. When you call DVM_FRAME the corresponding virtual device gets
real-ized onto the hardware and the frame is captured.

> I don't even think VfW allows for that.

By virtue of having a separate handle for each open, it does. Codecs get
opened multiple times too. Didn't you support multiple opens on your
codecs? You really *have* to.

> It's if you have multiple devices, then in makes sense.

It's as if you have as many devices as you want, but really only one.
It's called multitasking.

The driver keeps track of all device state, and can swap in and out
different state contexts. Actually, that made it really easy to support
hot-plugging when we made the PCMCIA cameras. When a device is unplugged
it's ok because you know exactly what state it was in, when it's plugged
back in you restore the state and it picks up where it left off. A
little code here and there and we had it so it was *completely*
transparent to the app whether the device was plugged in or not. You
could be capturing a movie, and yank the card out and the app would keep
on capturing (synthetic images now with a little missing-camera icon in
them :). And then put the card back in and the camera image reappears,
and the app had no idea whatsoever that anything happened. It's cool.

Bill.
------------
To unsubscribe from this list send mail to majordomo@phunk.org with the
line "unsubscribe video4linux" without the quotes in the body of the
message.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic