FileDocCategorySizeDatePackage
CaptureDeviceInfo.javaAPI DocJMF 2.1.1e2883Mon May 12 12:20:36 BST 2003javax.media

CaptureDeviceInfo

public class CaptureDeviceInfo extends Object implements Serializable
A CaptureDeviceInfo object contains information about a particular capture device.
since
JMF 2.0

Fields Summary
protected String
name
A String that contains the name of a device.
protected MediaLocator
locator
A MediaLocator that identifies a device.
protected Format[]
formats
The output formats supported by a device.
Constructors Summary
public CaptureDeviceInfo(String name, MediaLocator locator, Format[] formats)
Constructs a CaptureDeviceInfo object with the specified name, media locator, and array of Format objects.

param
name A String that contains the name of the device.
param
locator The MediaLocator that uniquely specifies the device.
param
formats An array of the output formats supported by the device.


                                                        
            
	this.name = name;
	this.locator = locator;
	this.formats = formats;
    
public CaptureDeviceInfo()
Constructs a CaptureDeviceInfo object with null attributes.

    
Methods Summary
public booleanequals(java.lang.Object obj)

	if (!(obj instanceof CaptureDeviceInfo))
	    return false;
	CaptureDeviceInfo cdi = (CaptureDeviceInfo) obj;
	return
	    name != null && locator != null && formats != null &&
	    name.equals(cdi.getName()) &&
	    locator.equals(cdi.getLocator()) &&
	    formats.equals(cdi.getFormats());
    
public javax.media.Format[]getFormats()
Gets a list of the output formats supported by this device.

return
A Format array that contains the output formats supported by this device.

	return formats;
    
public javax.media.MediaLocatorgetLocator()
Gets the MediaLocator needed to create a DataSource for this device through the Manager. The MediaLocator is unique--no two devices can use the same locator.

return
The MediaLocator that uniquely specifies this device.

	return locator;
    
public java.lang.StringgetName()
Gets the name of this device. The name might include the device name, vendor name, and a version number.

return
A String that describes this device.

	return name;
    
public java.lang.StringtoString()

	String result = name + " : " + locator + "\n";
	if (formats != null) {
	    for (int i = 0; i < formats.length; i++) {
		result += formats[i] + "\n";
	    }
	}
	return result;