Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple Video Grabbers



Hi,

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 ) { }'.


Hope this of use to someone.

Andre

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-java mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.