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

DataSource

public class DataSource extends BasicPushBufferDataSource

Fields Summary
private PushBufferStream[]
srcStreams
private boolean
stopped
Player
streamplayer
Constructors Summary
public DataSource()

    
     
    
        srcStreams= new PushBufferStream[ 1];
    
Methods Summary
public voidconnect()
Opens a connection to the source described by the URL.

Connect initiates communmication with the source.

exception
IOException thrown if the connect has IO trouble.

        connected = true;
    
public voiddisconnect()
Close the connection to the source described by the URL.

Disconnect frees resources used to maintain a connection to the source. If no resources are in use, disconnect is ignored. Implies a stop, if stop hasn't already been called.

        connected = false;
    
public java.lang.StringgetContentType()

	return "rtsp";
    
public java.lang.ObjectgetControl(java.lang.String controlName)
Returns null because no controls are implemented.

return
null.

        return null;
    
public java.lang.Object[]getControls()
Returns an zero length array because no controls are supported.

return
a zero length Object array.

        return null;        
    
public javax.media.PlayergetPlayer()

        return streamplayer;
    
public javax.media.protocol.PushBufferStream[]getStreams()
Obtain the collection of streams that this source manages. The collection of streams is entirely content dependent. The mime-type of this DataSource provides the only indication of what streams can be available on this connection.

return
collection of streams for this source.

        if (!connected)
      	    return null;
	return srcStreams;
    
public booleanisStarted()

        return started;
    
public voidsetControl(java.lang.Object control)

    
public voidsetLocator(javax.media.MediaLocator mrl)

        super.setLocator(mrl);
    
public voidsetPlayer(javax.media.Player player)

        streamplayer = player;
    
public voidsetSourceStream(javax.media.protocol.PushBufferStream stream)

        if (srcStreams != null)
      	    srcStreams[0] = stream;
    
public voidstart()
Initiates data-transfer. Start must be called before data is available. Connect must be called before start.

exception
IOException thrown if the source has IO trouble at startup time.

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

        super.stop();