com.sun.media
接口 Module

所有超级接口:
Controls
所有已知实现类:
BasicFilterModule, BasicModule, BasicMuxModule, BasicRendererModule, BasicSinkModule, BasicSourceModule

public interface Module
extends Controls

A Module is a "black box" which does a part of the overall processing.
It might have InputConnectors from which it receives data. It might have OutputConnectors to which it transmits data. its properties are exposed via Java Beans compliant accessing methods (setXXX()/getXXX)
getLatency(.) removed since it was not used

data transfer protocols

We define four protocols of data transfer between Modules:

另请参见:
Control, Connector, InputConnector, OutputConnector

方法摘要
 void connectorPushed(InputConnector inputConnector)
          A callback function denoting data was written to one of this Module input Connectors.
 InputConnector getInputConnector(java.lang.String connectorName)
          Return the specified input connector.
 java.lang.String[] getInputConnectorNames()
          Return an array of strings containing this Module's input connectors names (both connected and unconnected).
 java.lang.String getName()
          returns the name of this Module in the Player
 OutputConnector getOutputConnector(java.lang.String connectorName)
          Return the specified output connector.
 java.lang.String[] getOutputConnectorNames()
          Return an array of strings containing this Module's output connectors names (both connected and unconnected).
 boolean isInterrupted()
          Query to see if the module has just been interrupted.
 void registerInputConnector(java.lang.String name, InputConnector in)
          Each of the inputConnectors of this Module has to be registered with this function.
 void registerOutputConnector(java.lang.String name, OutputConnector out)
          Each of the outputConnectors of this Module has to be registered with this function.
 void reset()
          Return the Module to its initial state.
 void setFormat(Connector connector, Format format)
          Selects a format for the Connector (the default is null).
 void setJMD(JMD jmd)
          Set the JMD debugger instance for the module to use.
 void setModuleListener(ModuleListener listener)
          Specify a ModuleListener to which this Module will send events.
 void setName(java.lang.String name)
          sets the name of this Module.
 
从接口 javax.media.Controls 继承的方法
getControl, getControls
 

方法详细信息

getInputConnectorNames

java.lang.String[] getInputConnectorNames()
Return an array of strings containing this Module's input connectors names (both connected and unconnected). If this Module contains no inputs an array of length zero is returned.

返回:
list of input connectors as strings.

getOutputConnectorNames

java.lang.String[] getOutputConnectorNames()
Return an array of strings containing this Module's output connectors names (both connected and unconnected). If this Module contains no outputs an array of length zero is returned.

返回:
list of output connectors as strings.

getInputConnector

InputConnector getInputConnector(java.lang.String connectorName)
Return the specified input connector. Connectors and their names are typically constructed in the Module's constructor, but their construction can be delayed until the Player Realizing state. Returns null if the string doesn't match any of the Module's InputConnectors.

参数:
connectorName - the name of the connector.
返回:
InputConnector associated with this name.

getOutputConnector

OutputConnector getOutputConnector(java.lang.String connectorName)
Return the specified output connector. Connectors and their names are typically constructed in the Module's constructor. Returns null if the String doesn't match any of the Module's OutputConnectors.

参数:
connectorName - the name of the connector
返回:
OutputConnector associated with this name.

registerInputConnector

void registerInputConnector(java.lang.String name,
                            InputConnector in)
Each of the inputConnectors of this Module has to be registered with this function. This method also sets the Module reference of the Connector


registerOutputConnector

void registerOutputConnector(java.lang.String name,
                             OutputConnector out)
Each of the outputConnectors of this Module has to be registered with this function. This method also sets the Module reference of the Connector


reset

void reset()
Return the Module to its initial state.
A Module should call its Connectors reset method, and then clear its internal buffers typically by calling the StateTransistor's method dealloc().


connectorPushed

void connectorPushed(InputConnector inputConnector)
A callback function denoting data was written to one of this Module input Connectors. This function is needed in case of Push protocol Typical reaction of the module is to process one frame in the calling thread and return.

参数:
inputConnector - the inputConnector of the connection which have received data.

getName

java.lang.String getName()
returns the name of this Module in the Player


setName

void setName(java.lang.String name)
sets the name of this Module. Called by the owning Player registerModule() method


setFormat

void setFormat(Connector connector,
               Format format)
Selects a format for the Connector (the default is null). The setFormat() method is typically called by the Manager as part of the Connector connection method call. Typically the connector would delegate this call to its owning Module.


setModuleListener

void setModuleListener(ModuleListener listener)
Specify a ModuleListener to which this Module will send events.

参数:
listener - The listener to which the Module will post events.

isInterrupted

boolean isInterrupted()
Query to see if the module has just been interrupted.

返回:
true if the module has just been interrupted.

setJMD

void setJMD(JMD jmd)
Set the JMD debugger instance for the module to use.