Methods Summary |
---|
public com.sun.media.OutputConnector | getOutputConnector()Return the OutputConnector this InputConnector is connected
to. If this Connector is unconnected return null.
return outputConnector;
|
public javax.media.Buffer | getValidBuffer()Get buffer object containing media.
// System.out.println(getClass().getName()+":: getValidBuffer");
switch (protocol) {
case ProtocolPush:
synchronized (circularBuffer) {
if ( !isValidBufferAvailable() && reset)
return null;
reset = false;
return (Buffer)circularBuffer.read();
}
case ProtocolSafe:
synchronized (circularBuffer ) {
reset = false;
while ( !reset && !isValidBufferAvailable() ) {
try {
circularBuffer.wait();
} catch (Exception e) {}
}
if (reset)
return null;
Buffer buffer = (Buffer)circularBuffer.read();
circularBuffer.notifyAll();
return buffer;
}
default:
throw new RuntimeException();
}
|
public boolean | isValidBufferAvailable()returns if there are valid Buffer objects in the Connector's queue.
return circularBuffer.canRead();
|
public void | readReport()Indicates the oldest Buffer object got from this Connector was used and can
be "recycled" by the upstream Module.
// System.out.println(getClass().getName()+":: readReport");
switch ( protocol ) {
case ProtocolPush:
case ProtocolSafe:
synchronized (circularBuffer ) {
if (reset) return;
circularBuffer.readReport();
circularBuffer.notifyAll();
return;
}
default:
throw new RuntimeException();
}
|
public void | reset()
synchronized (circularBuffer) {
reset = true;
super.reset();
circularBuffer.notifyAll();
}
|
public void | setOutputConnector(com.sun.media.OutputConnector outputConnector)Sets the OutputConnector this InputConnector is connected
to. This method is called by the connectTo() method of the OutputConnector.
this.outputConnector=outputConnector;
|