FileDocCategorySizeDatePackage
BasicPullBufferDataSource.javaAPI DocJMF 2.1.1e1987Mon May 12 12:20:54 BST 2003com.sun.media.protocol

BasicPullBufferDataSource

public abstract class BasicPullBufferDataSource extends PullBufferDataSource

Fields Summary
protected Object[]
controls
protected boolean
started
protected String
contentType
protected boolean
connected
protected Time
duration
Constructors Summary
Methods Summary
public voidconnect()

	 if (connected)
            return;
	 connected = true;
    
public voiddisconnect()

	try{
            if (started)
                stop();
        }catch (IOException e){}
	connected = false;
    
public java.lang.StringgetContentType()

    
       
	if (!connected){
            System.err.println("Error: DataSource not connected");
            return null;
        }
	return contentType;
    
public java.lang.ObjectgetControl(java.lang.String controlType)

       try {
          Class  cls = Class.forName(controlType);
          Object cs[] = getControls();
          for (int i = 0; i < cs.length; i++) {
             if (cls.isInstance(cs[i]))
                return cs[i];
          }
          return null;

       } catch (Exception e) {   // no such controlType or such control
         return null;
       }
    
public java.lang.Object[]getControls()

	return controls;
    
public javax.media.TimegetDuration()

	return duration;
    
public voidstart()

	// 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;
	started = true;
    
public voidstop()

	if ((!connected) || (!started))
	    return;
	started = false;