|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.Objectcom.sun.media.BasicModule
com.sun.media.BasicSourceModule
public class BasicSourceModule
MediaSource is a module which have OutputConnectors and no InputConnectors.
It receives data from PullSourceStream and stream the data to the downstream modules
(in case of PushSourceStream an adapter should be written Push2Pull such as the RTP "bucket" adapter).
MediaSource are typically not threaded and use Pull protocol
(URL connection is really threaded but everything goes "under the hood"
so we refer to it as unthreaded one).
This class support data caching in either memory or disk.
When an attemped read would block, the Player would Restart (in order to fetch data).
We need the level 3 design for:
| 字段摘要 | |
|---|---|
protected long |
bitsRead
|
protected java.lang.String[] |
connectorNames
|
protected long |
currentSystemTime
|
java.lang.String |
errMsg
|
protected Time |
lastPositionSet
|
protected long |
lastSystemTime
|
protected com.sun.media.SourceThread[] |
loops
|
protected long |
originSystemTime
|
protected Demultiplexer |
parser
|
protected javax.media.protocol.DataSource |
source
|
protected boolean |
started
|
protected SystemTimeBase |
systemTimeBase
|
protected Track[] |
tracks
|
| 从类 com.sun.media.BasicModule 继承的字段 |
|---|
controller, inputConnectors, inputConnectorsArray, jmd, moduleListener, name, outputConnectors, outputConnectorsArray, prefetchFailed, protocol, resetted |
| 从接口 javax.media.Duration 继承的字段 |
|---|
DURATION_UNBOUNDED, DURATION_UNKNOWN |
| 从接口 javax.media.protocol.Positionable 继承的字段 |
|---|
RoundDown, RoundNearest, RoundUp |
| 构造方法摘要 | |
|---|---|
protected |
BasicSourceModule(javax.media.protocol.DataSource ds,
Demultiplexer demux)
|
| 方法摘要 | |
|---|---|
void |
abortPrefetch()
Called when the prefetch() is aborted, i.e. deallocate() was called while prefetching. |
void |
abortRealize()
Called when the realize() is aborted, i.e. deallocate() was called while realizing. |
protected boolean |
checkAllPaused()
|
void |
checkLatency()
|
protected static Demultiplexer |
createDemultiplexer(javax.media.protocol.DataSource ds)
Create a plugin parser based on the input DataSource. |
static BasicSourceModule |
createModule(javax.media.protocol.DataSource ds)
|
void |
doClose()
This function performs the steps to close a module or Player. |
void |
doDealloc()
This function performs the steps to deallocate a module or Player, and return to the realized state. |
void |
doFailedPrefetch()
Called when prefetch fails. |
void |
doFailedRealize()
Called when realize fails. |
boolean |
doPrefetch()
This function performs the steps to prefetch a module or Player. |
boolean |
doRealize()
Parsed in the input to get the track info. |
void |
doStart()
This function performs the steps to start a module or Player. |
void |
doStop()
This is a blocking pause. |
long |
getBitsRead()
|
java.lang.Object |
getControl(java.lang.String s)
Obtain the object that implements the specified Class or Interface
The full class or interface name must be used. |
java.lang.Object[] |
getControls()
Return a list of module controls. |
Demultiplexer |
getDemultiplexer()
|
Time |
getDuration()
Get the duration of the media represented by this object. |
java.lang.String[] |
getOutputConnectorNames()
Return an array of strings containing this media module's output port names. |
boolean |
isPositionable()
|
boolean |
isRandomAccess()
Find out if this source can be repositioned to any point in the stream. |
void |
pause()
This is essentially a non-blocking version of doStop. |
void |
process()
function which does the real processing. |
void |
reset()
reset this module only. |
void |
resetBitsRead()
|
void |
setFormat(Connector connector,
Format format)
Selects a format for this Connector (the default is null). |
Time |
setPosition(Time when,
int rounding)
Set the position to the specified time. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected javax.media.protocol.DataSource source
protected Demultiplexer parser
protected Track[] tracks
protected com.sun.media.SourceThread[] loops
protected java.lang.String[] connectorNames
protected long bitsRead
protected boolean started
protected SystemTimeBase systemTimeBase
protected long lastSystemTime
protected long originSystemTime
protected long currentSystemTime
protected Time lastPositionSet
public java.lang.String errMsg
| 构造方法详细信息 |
|---|
protected BasicSourceModule(javax.media.protocol.DataSource ds,
Demultiplexer demux)
| 方法详细信息 |
|---|
public static BasicSourceModule createModule(javax.media.protocol.DataSource ds)
throws java.io.IOException,
IncompatibleSourceException
java.io.IOException
IncompatibleSourceException
protected static Demultiplexer createDemultiplexer(javax.media.protocol.DataSource ds)
throws java.io.IOException,
IncompatibleSourceException
java.io.IOException
IncompatibleSourceExceptionpublic boolean doRealize()
StateTransistor 中的 doRealizeBasicModule 中的 doRealizepublic void doFailedRealize()
BasicModule 复制的描述
StateTransistor 中的 doFailedRealizeBasicModule 中的 doFailedRealizepublic void abortRealize()
BasicModule 复制的描述
StateTransistor 中的 abortRealizeBasicModule 中的 abortRealizepublic boolean doPrefetch()
BasicModule 复制的描述
StateTransistor 中的 doPrefetchBasicModule 中的 doPrefetchpublic void doFailedPrefetch()
BasicModule 复制的描述
StateTransistor 中的 doFailedPrefetchBasicModule 中的 doFailedPrefetchpublic void abortPrefetch()
BasicModule 复制的描述
StateTransistor 中的 abortPrefetchBasicModule 中的 abortPrefetchpublic void doStart()
BasicModule 复制的描述
StateTransistor 中的 doStartBasicModule 中的 doStartpublic void doStop()
StateTransistor 中的 doStopBasicModule 中的 doStoppublic void pause()
public void doDealloc()
BasicModule 复制的描述
StateTransistor 中的 doDeallocBasicModule 中的 doDeallocpublic void doClose()
BasicModule 复制的描述
StateTransistor 中的 doCloseBasicModule 中的 doClosepublic void reset()
BasicModule 复制的描述
if (state== Started)
throw Exception()
for (all connectors)
connector.reset()
The resetted flag is falsified only when the module is later restarted.
Module 中的 resetBasicModule 中的 resetpublic java.lang.String[] getOutputConnectorNames()
Module 中的 getOutputConnectorNamesBasicModule 中的 getOutputConnectorNamespublic Time getDuration()
Duration 复制的描述getDuration returns DURATION_UNKNOWN.
Duration 中的 getDurationTime object representing the duration or DURATION_UNKNOWN.
public Time setPosition(Time when,
int rounding)
javax.media.protocol.Positionable 复制的描述
javax.media.protocol.Positionable 中的 setPositionpublic boolean isPositionable()
public boolean isRandomAccess()
javax.media.protocol.Positionable 复制的描述
javax.media.protocol.Positionable 中的 isRandomAccesstrue if the source is random access; false if the source can only
be reset to the beginning of the stream.public java.lang.Object[] getControls()
BasicModule 复制的描述
Controls 中的 getControlsBasicModule 中的 getControlspublic java.lang.Object getControl(java.lang.String s)
Controls 复制的描述Class or Interface
The full class or interface name must be used.
If the control is not supported then null
is returned.
Controls 中的 getControlBasicModule 中的 getControlnull.public Demultiplexer getDemultiplexer()
public void setFormat(Connector connector,
Format format)
BasicModule 复制的描述
Module 中的 setFormatBasicModule 中的 setFormatpublic void process()
BasicModule 复制的描述
if canRun {
for (all inputConnectors)
ic.getValidBuffer()
for (all outputConnectors)
oc.getEmptyBuffer()
for (all inputConnectors)
ic.readReport()
for (all outputConnectors)
oc.writeReport()
}
BasicModule 中的 processpublic long getBitsRead()
public void resetBitsRead()
public void checkLatency()
protected boolean checkAllPaused()
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||