FileDocCategorySizeDatePackage
BasicSinkModule.javaAPI DocJMF 2.1.1e2533Mon May 12 12:20:50 BST 2003com.sun.media

BasicSinkModule

public abstract class BasicSinkModule extends BasicModule
BasicSinkModule is the base class for the modules that are the end points of a flow graph. Renderer modules and Multiplexer modules are two decendents of it. It manages a clock that could be used as the time base of the entire Player or Processor.

Fields Summary
private Clock
clock
protected boolean
prerolling
protected float
rate
protected long
stopTime
Constructors Summary
Methods Summary
public voiddoSetMediaTime(javax.media.Time t)

	if (clock != null)
	    clock.setMediaTime(t);
    
public floatdoSetRate(float r)

	if (clock != null)
	    rate = clock.setRate(r);
	else
	    rate = r;
	return rate;
    
public voiddoStart()


       
	super.doStart();
	if (clock != null)
	    clock.syncStart(clock.getTimeBase().getTime());
    
public voiddoStop()

	if (clock != null)
	    clock.stop();
    
public voiddoneReset()

    
public javax.media.ClockgetClock()

	return clock;
    
public longgetMediaNanoseconds()

	if (clock != null)
	    return clock.getMediaNanoseconds();
	else
	    return controller.getMediaNanoseconds();
    
public javax.media.TimegetMediaTime()

	if (clock != null)
	    return clock.getMediaTime();
	else
	    return controller.getMediaTime();
    
public javax.media.TimeBasegetTimeBase()

	if (clock != null)
	    return clock.getTimeBase();
	else
	    return controller.getTimeBase();
    
protected voidsetClock(javax.media.Clock c)

	clock = c;
    
public voidsetPreroll(long wanted, long actual)
Enable prerolling.

param
t the media time when the prerolling starts. Let's say the the requested media time is set to 100 and the current location is set to 90 (the previous key frame where the parser can seek to). The parameter t should be set to 90.

	// If the time actually set on the parser is less than
	// the time requested, we'll preroll the media
	// to the requested time.
	if (actual < wanted)
	    prerolling = true;
    
public voidsetStopTime(javax.media.Time t)

	if (t == Clock.RESET)
	    stopTime = -1;
	else
	    stopTime = t.getNanoseconds();
    
public voidsetTimeBase(javax.media.TimeBase tb)

	if (clock != null)
	    clock.setTimeBase(tb);
    
public voidtriggerReset()