|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.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
IncompatibleSourceException
public boolean doRealize()
StateTransistor
中的 doRealize
BasicModule
中的 doRealize
public void doFailedRealize()
BasicModule
复制的描述
StateTransistor
中的 doFailedRealize
BasicModule
中的 doFailedRealize
public void abortRealize()
BasicModule
复制的描述
StateTransistor
中的 abortRealize
BasicModule
中的 abortRealize
public boolean doPrefetch()
BasicModule
复制的描述
StateTransistor
中的 doPrefetch
BasicModule
中的 doPrefetch
public void doFailedPrefetch()
BasicModule
复制的描述
StateTransistor
中的 doFailedPrefetch
BasicModule
中的 doFailedPrefetch
public void abortPrefetch()
BasicModule
复制的描述
StateTransistor
中的 abortPrefetch
BasicModule
中的 abortPrefetch
public void doStart()
BasicModule
复制的描述
StateTransistor
中的 doStart
BasicModule
中的 doStart
public void doStop()
StateTransistor
中的 doStop
BasicModule
中的 doStop
public void pause()
public void doDealloc()
BasicModule
复制的描述
StateTransistor
中的 doDealloc
BasicModule
中的 doDealloc
public void doClose()
BasicModule
复制的描述
StateTransistor
中的 doClose
BasicModule
中的 doClose
public 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
中的 reset
BasicModule
中的 reset
public java.lang.String[] getOutputConnectorNames()
Module
中的 getOutputConnectorNames
BasicModule
中的 getOutputConnectorNames
public Time getDuration()
Duration
复制的描述getDuration
returns DURATION_UNKNOWN
.
Duration
中的 getDuration
Time
object representing the duration or DURATION_UNKNOWN.public Time setPosition(Time when, int rounding)
javax.media.protocol.Positionable
复制的描述
javax.media.protocol.Positionable
中的 setPosition
public boolean isPositionable()
public boolean isRandomAccess()
javax.media.protocol.Positionable
复制的描述
javax.media.protocol.Positionable
中的 isRandomAccess
true
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
中的 getControls
BasicModule
中的 getControls
public 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
中的 getControl
BasicModule
中的 getControl
null
.public Demultiplexer getDemultiplexer()
public void setFormat(Connector connector, Format format)
BasicModule
复制的描述
Module
中的 setFormat
BasicModule
中的 setFormat
public 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
中的 process
public long getBitsRead()
public void resetBitsRead()
public void checkLatency()
protected boolean checkAllPaused()
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |