javax.media.protocol
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.

Since:
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

getCaptureDeviceInfo

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

getFormatControls

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.
Returns:
an array for FormatControls.

connect

public void connect()
             throws java.io.IOException
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:
java.io.IOException - Thrown if there are IO problems when connect is called.

disconnect

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.


start

public void start()
           throws java.io.IOException
Start the data capture.

stop

public void stop()
          throws java.io.IOException
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.