FileDocCategorySizeDatePackage
CloneableCapturePushDataSource.javaAPI DocJMF 2.1.1e6282Mon May 12 12:21:04 BST 2003com.ibm.media.protocol

CloneableCapturePushDataSource

public class CloneableCapturePushDataSource extends PushDataSource implements CaptureDevice, SourceCloneable
This is a utility class for creating clones of PushDataSource. THe class reflects the functionality of a PushDataSource and provides a getClone() method for generating clones. The generated clone will be of type PushDataSource and its streams will generate a trasferData() call each time the PushDataSource's streams call transferData(). This class also implements the CaptureDevice interface.

Fields Summary
private SuperCloneableDataSource
superClass
Constructors Summary
public CloneableCapturePushDataSource(PushDataSource source)
Constructor

param
source the source to be cloned


	superClass = new SuperCloneableDataSource(source);
    
Methods Summary
public voidconnect()
Open a connection to the source described by the MediaLocator.

The connect method initiates communication with the source.

exception
IOException Thrown if there are IO problems when connect is called.

    
	superClass.connect();
    
public javax.media.protocol.DataSourcecreateClone()
Clone the original datasource, returning an object of the type PushDataSource or PushBufferDataSource. If the original data source was a PullDataSource, then this will be a PushDataSource which pushes at the same rate at which the CloneableDataSource is being pulled.

return
a slave DataSource for this DataSource.

  
	return superClass.createClone();
    
public voiddisconnect()
Close the connection to the source described by the locator.

The disconnect method frees resources used to maintain a connection to the source. If no resources are in use, disconnect is ignored. If stop hasn't already been called, calling disconnect implies a stop.

    
	superClass.disconnect();
    
public javax.media.CaptureDeviceInfogetCaptureDeviceInfo()
Return the CaptureDeviceInfo object that describes this device.

return
The CaptureDeviceInfo object that describes this device.

    
    return ((CaptureDevice)superClass.input).getCaptureDeviceInfo();
  
public java.lang.StringgetContentType()
Get a string that describes the content-type of the media that the source is providing.

It is an error to call getContentType if the source is not connected.

return
The name that describes the media content.

    
	return superClass.getContentType();
    
public java.lang.ObjectgetControl(java.lang.String controlType)
Obtain the object that implements the specified Class or Interface The full class or interface name must be used.

If the control is not supported then null is returned.

return
the object that implements the control, or null.

    
	return superClass.getControl(controlType);
    
public java.lang.Object[]getControls()
Obtain the collection of objects that control the object that implements this interface.

If no controls are supported, a zero length array is returned.

return
the collection of object controls

    
	return superClass.getControls();
    
public javax.media.TimegetDuration()
Get the duration of the media represented by this object. The value returned is the media's duration when played at the default rate. If the duration can't be determined (for example, the media object is presenting live video) getDuration returns DURATION_UNKNOWN.

return
A Time object representing the duration or DURATION_UNKNOWN.

    
	return superClass.getDuration();
    
public javax.media.control.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.

return
an array for FormatControls.

    
    return ((CaptureDevice)superClass.input).getFormatControls();
  
public javax.media.protocol.PushSourceStream[]getStreams()
Get the collection of streams that this source manages. The collection of streams is entirely content dependent. The ContentDescriptor of this DataSource provides the only indication of what streams can be available on this connection.

return
The collection of streams for this source.

    
	if (superClass.streams == null) {
	    superClass.streams = new PushSourceStream[superClass.streamsAdapters.length];
	    for (int i = 0; i < superClass.streamsAdapters.length; i++)
		superClass.streams[i] = (PushSourceStream)superClass.streamsAdapters[i].getAdapter();
	}

	return (PushSourceStream[])superClass.streams;
    
public voidstart()
Initiate data-transfer. The start method must be called before data is available. (You must call connect before calling start.)

exception
IOException Thrown if there are IO problems with the source when start is called.


	superClass.start(); 
    
public voidstop()
Stop the data-transfer. If the source has not been connected and started, stop does nothing.

    
	superClass.stop();