Interface CaptureDevice

public interface CaptureDevice

CaptureDevice is the interface for all capture devices.

A capture device is a DataSource of the type PullDataSource, PullBufferDataSource, PushDataSource or PushBufferDataSource. It also implements the CaptureDevice interface which further specializes the DataSource to handle data capturing.

A capture DataSource contains an array of SourceStream's. These SourceStreams provide the interface for the captured data streams to be read.

The formats of the captured data can be manipulated by the FormatControl objects. There is one FormatControl per each capture stream. These controls can be obtained by the getFormatControls method.

A few methods from the DataSource are re-defined to support semantics of capture devices.

JMF 2.0
See Also:
DataSource, SourceStream, FormatControl

Method Summary
 void connect()
          Initialize the capture device.
 void disconnect()
          Close the capture device.
 CaptureDeviceInfo getCaptureDeviceInfo()
          Return the CaptureDeviceInfo object that describes this device.
 FormatControl[] getFormatControls()
          Returns an array of FormatControl objects.
 void start()
          Start the data capture.
 void stop()
          Stop the data capture.

Method Detail


public CaptureDeviceInfo getCaptureDeviceInfo()
Return the CaptureDeviceInfo object that describes this device.
The CaptureDeviceInfo object that describes this device.


public FormatControl[] getFormatControls()
Returns an array of FormatControl objects. Each of them can be used to set and get the format of each capture stream. This method can be used before connect to set and get the capture formats.
an array for FormatControls.


public void connect()
Initialize the capture device. The device will be initialized to the formats specified by using the FormatControl. The default will be used if no formats were specified.

After connect, the resources required by the device will be allocated. If the device is an exclusive device, connect from other capture DataSource's referring to the same device will fail.

Throws: - Thrown if there are IO problems when connect is called.


public void disconnect()
Close the capture device. It frees the resources held by the device.

If stop hasn't already been called, calling disconnect implies a stop. connect may be called again to re-open the device.


public void start()
Start the data capture.


public void stop()
Stop the data capture.

Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.