Methods Summary |
---|
public void | connect()
if (connected)
return;
if (master != null)
master.connect();
connected = true;
|
public void | disconnect()
try{
if (started)
stop();
}catch (IOException e){}
if (master != null)
master.disconnect();
connected = false;
|
public java.lang.String | getContentType()
if (!connected){
System.err.println("Error: DataSource not connected");
return null;
}
return contentType;
|
public java.lang.Object | getControl(java.lang.String controlType)
if (master != null)
return master.getControl(controlType);
return null;
|
public java.lang.Object[] | getControls()
if (master != null)
return master.getControls();
return new Object[0];
|
public javax.media.Time | getDuration()
if (master != null)
return master.getDuration();
return Duration.DURATION_UNKNOWN;
|
public javax.media.MediaLocator | getLocator()
if (master != null)
return master.getLocator();
return null;
|
public javax.media.protocol.DataSource | getMaster()
return master;
|
public javax.media.protocol.PushBufferStream[] | getStreams()
return streams;
|
public boolean | isPrefetchable()
return false;
|
public void | setMaster(javax.media.protocol.PushBufferDataSource ds)
master = ds;
PushBufferStream mstrms[] = ds.getStreams();
for (int i = 0; i < mstrms.length; i++) {
for (int j = 0; j < streams.length; j++) {
if (streams[j].getFormat().matches(mstrms[i].getFormat()))
streams[j].setMaster(mstrms[i]);
}
}
for (int i = 0; i < mstrms.length; i++) {
if (streams[i].getMaster() == null) {
Log.error("DelegateDataSource: cannot not find a matching track from the master with this format: " + streams[i].getFormat());
}
}
if (connected)
master.connect();
if (started)
master.start();
|
public void | start()
// we need to throw error if connect() has not been called
if (!connected)
throw new java.lang.Error("DataSource must be connected before it can be started");
if (started)
return;
if (master != null)
master.start();
started = true;
|
public void | stop()
if ((!connected) || (!started))
return;
if (master != null)
master.stop();
started = false;
|