javax.media.cdm
Class CaptureDeviceManager

java.lang.Object
  |
  +--javax.media.CaptureDeviceManager
        |
        +--javax.media.cdm.CaptureDeviceManager

public class CaptureDeviceManager
extends CaptureDeviceManager

This is a manager class that fetches a list of devices available on the system. It uses a registry mechanism and/or query mechanism to locate devices and return CaptureDeviceInfo objects for each available device. The CaptureDeviceManager can also be used to register new devices by adding a device and calling commit().

Since:
JMF 2.0

Field Summary
(package private) static java.util.Vector devices
           
 
Constructor Summary
CaptureDeviceManager()
           
 
Method Summary
static boolean addDevice(CaptureDeviceInfo newDevice)
          Adds a CaptureDeviceInfo object to the list.
static void commit()
          Permanently store information about the list of devices in a registry.
static CaptureDeviceInfo getDevice(java.lang.String deviceName)
          Returns the CaptureDeviceInfo corresponding to the specified name of the device.
static java.util.Vector getDeviceList()
          Returns a list of CaptureDeviceInfo objects for each of the registered devices.
static java.util.Vector getDeviceList(Format format)
          Returns a list of CaptureDeviceInfo objects corresponding to devices that can capture data with the specified data format.
static boolean removeDevice(CaptureDeviceInfo device)
          Removes a CaptureDeviceInfo object from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

devices

static java.util.Vector devices
Constructor Detail

CaptureDeviceManager

public CaptureDeviceManager()
Method Detail

getDeviceList

public static java.util.Vector getDeviceList()
Returns a list of CaptureDeviceInfo objects for each of the registered devices.

Returns:
a list of CaptureDeviceInfo objects for each of the registered devices.

getDevice

public static CaptureDeviceInfo getDevice(java.lang.String deviceName)
Returns the CaptureDeviceInfo corresponding to the specified name of the device. For example: "SunVideo". Returns null if the device could not be found.

Parameters:
deviceName - A String that contains the name of the device for which you want to get a CaptureDeviceInfo object. For example: "SunVideo".
Returns:
the CaptureDeviceInfo corresponding to the specified name of theo * device.

getDeviceList

public static java.util.Vector getDeviceList(Format format)
Returns a list of CaptureDeviceInfo objects corresponding to devices that can capture data with the specified data format. If format is null then it returns all registered objects

Returns:
a list of CaptureDeviceInfo objects for the given data format.

addDevice

public static boolean addDevice(CaptureDeviceInfo newDevice)
Adds a CaptureDeviceInfo object to the list. This information is not stored permanently in any registry. If a similar CaptureDeviceInfo object is already registered, then the new device is not added.

Parameters:
newDevice - A CaptureDeviceInfo object that identifies the new device.
Returns:
true if the object could be added, false otherwise.
See Also:
commit()

removeDevice

public static boolean removeDevice(CaptureDeviceInfo device)
Removes a CaptureDeviceInfo object from the list.

Parameters:
device - A CaptureDeviceInfo object that identifies the device to remove.
Returns:
true if the object is removed successfully, false if it is not.
See Also:
commit()

commit

public static void commit()
                   throws java.io.IOException
Permanently store information about the list of devices in a registry.

Returns:
false if the commit fails.
Throws:
java.io.IOException - If the registry could not be committed to disk due to an IO error.