I remember reading at some point someone saying that Quicktime didn't
support multiple simultaneous
video sources. Last night I did a test that showed that this isn't
true. The setup is the built-in
camera of my MacBook Pro and a USB Logitech webcam (the PowerPC
driver works more or less). I can't
confirm how Quicktime deals with multiple cameras of the same make/
model, so I would be curious to
find out.
For those interested a snippet of part of the code is here:
this.grabber = new SequenceGrabber();
this.channel = new SGVideoChannel(this.grabber);
SGDeviceList devices = channel.getDeviceList(0);
for (int i=0; i<devices.getCount(); i++) {
SGDeviceName deviceName = devices.getDeviceName(i);
// is it available?
if ((deviceName.getFlags() &
StdQTConstants.sgDeviceNameFlagDeviceUnavailable)
== 0)
{
System.out.println(i + " .. " + deviceName.getName());
if ( i == this.sourceIdx )
{
this.channel.setDevice(deviceName.getName());
}
}
}
This code will go through the list of available video sequence
grabbers, testing to see if they
are available and if the sourceIdx matches the device index it will
select it for use (there
are probably better match tests, but this does the job for now). Note
that if you pass
'StdQTConstants.sgDeviceListDontCheckAvailability' to the
getDeviceList() method,
then the availability test if statement essentially resolves to 'if
( true ) { }'.