FileDocCategorySizeDatePackage
DataSource.javaAPI DocJMF 2.1.1e3789Mon May 12 12:20:54 BST 2003com.sun.media.protocol.javasound

DataSource

public class DataSource extends BasicPushBufferDataSource implements CaptureDevice, RateConfigureable

Fields Summary
PushBufferStream[]
streams
JavaSoundSourceStream
sourceStream
String
contentType
Time
duration
boolean
started
static String
ContentType
Constructors Summary
public DataSource()


      
	com.sun.media.JMFSecurityManager.checkCapture();
	contentType = ContentType;
	duration = DURATION_UNBOUNDED;
	sourceStream = new JavaSoundSourceStream(this);
	streams = new PushBufferStream[1];
	streams[0] = sourceStream;
    
Methods Summary
public voidconnect()

	//	System.err.println("JavaSoundDataSource.connect()");
	if (sourceStream.isConnected())
	    return;

	if (getLocator() != null)
	    sourceStream.setFormat(JavaSoundSourceStream.parseLocator(getLocator()));
	sourceStream.connect();
    
public voiddisconnect()

	//	System.err.println("JavaSoundDataSource.disconnect()");
	sourceStream.disconnect();
    
public javax.media.CaptureDeviceInfogetCaptureDeviceInfo()

	return (JavaSoundSourceStream.listCaptureDeviceInfo())[0];
    
public java.lang.StringgetContentType()

	//	System.err.println("JavaSoundDataSource.getContentType() ");
	return contentType;
    
public java.lang.ObjectgetControl(java.lang.String name)

	//	System.err.println("JavaSoundDataSource.getControl(): " + name);
	return sourceStream.getControl(name);
    
public java.lang.Object[]getControls()

	//	System.err.println("JavaSoundDataSource.getControls()");
	Object o[] = sourceStream.getControls();
	return o;
    
public javax.media.TimegetDuration()

	//	System.err.println("JavaSoundDataSource.getDuration()");
	return duration;
    
public javax.media.control.FormatControl[]getFormatControls()

	FormatControl fc[] = new FormatControl[1];
	fc[0] = (FormatControl)sourceStream.getControl("javax.media.control.FormatControl");
	return fc;
    
public javax.media.protocol.RateConfiguration[]getRateConfigurations()
Methods for the RateConfigurable interface.

	RateConfiguration config [] = { new OneRateConfig() };
	return config;
    
booleangetStarted()

	//	System.err.println("JavaSoundDataSource.getStarted()");
	return started;
    
public javax.media.protocol.PushBufferStream[]getStreams()

	//	System.err.println("JavaSoundDataSource.getStreams()");
	if (streams == null)
	    System.err.println(
		"DataSource needs to be connected before calling getStreams");
	return streams;
    
public static javax.media.CaptureDeviceInfo[]listCaptureDeviceInfo()

	return JavaSoundSourceStream.listCaptureDeviceInfo();
    
public javax.media.protocol.RateConfigurationsetRateConfiguration(javax.media.protocol.RateConfiguration config)

	return config;
    
public voidstart()

	//	System.err.println("JavaSoundDataSource.start()");
	sourceStream.start();
    
public voidstop()

	//	System.err.println("JavaSoundDataSource.stop()");
	sourceStream.stop();