|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.Objectcom.sun.media.BasicController
com.sun.media.BasicPlayer
public abstract class BasicPlayer
BasicPlayer implements the bases of a javax.media.Player. It handles all the Player state transitions, event handling and management of any Controller under its control.
| 字段摘要 | |
|---|---|
protected javax.media.control.BufferControl |
bufferControl
|
protected CachingControl |
cachingControl
|
protected java.awt.Component |
controlComp
|
protected java.util.Vector |
controllerList
|
protected Control[] |
controls
|
protected ExtendedCachingControl |
extendedCachingControl
|
protected boolean |
framePositioning
|
com.sun.media.controls.SliderRegionControl |
regionControl
|
protected javax.media.protocol.DataSource |
source
|
static java.lang.String |
VERSION
|
| 从类 com.sun.media.BasicController 继承的字段 |
|---|
processError, state, stopThreadEnabled |
| 从接口 javax.media.Controller 继承的字段 |
|---|
LATENCY_UNKNOWN, Prefetched, Prefetching, Realized, Realizing, Started, Unrealized |
| 从接口 javax.media.Clock 继承的字段 |
|---|
RESET |
| 从接口 javax.media.Duration 继承的字段 |
|---|
DURATION_UNBOUNDED, DURATION_UNKNOWN |
| 构造方法摘要 | |
|---|---|
BasicPlayer()
|
|
| 方法摘要 | |
|---|---|
protected void |
abortPrefetch()
Called when the prefetch() is aborted, i.e. deallocate() was called while prefetching. |
protected void |
abortRealize()
Called when the realize() is aborted, i.e. deallocate() was called while realizing. |
void |
addController(Controller newController)
Assume control of another Controller. |
protected abstract boolean |
audioEnabled()
Return true if the player is currently playing media with an audio track. |
protected void |
completeConfigure()
Called as a last step to complete the configure call. |
protected void |
completePrefetch()
Called as a last step to complete the prefetch call. |
protected void |
completeRealize()
Called as a last step to complete the realize call. |
protected void |
controllerSetStopTime(Time t)
This is for subclass to access Controller's implementation of setStopTime. |
protected void |
controllerStopAtTime()
This is for subclass to access Controller's implementation of stopAtTime. |
void |
controllerUpdate(ControllerEvent evt)
This get called when some Controller notifies this player of any event. |
protected boolean |
deviceBusy(BasicController mc)
Check the given controller to see if it's busy or not. |
protected void |
doClose()
This is called when close() is invoked on the Player. |
protected boolean |
doConfigure()
The stub function (invoked from configure()) to perform the steps to configure the player. |
protected void |
doFailedConfigure()
Called when configure fails. |
protected void |
doFailedPrefetch()
Called when prefetch fails. |
protected void |
doFailedRealize()
Called when realize fails. |
protected boolean |
doPrefetch()
The stub function to perform the steps to prefetch the controller. |
protected boolean |
doRealize()
The stub function (invoked from configure()) to perform the steps to configure the player. |
protected void |
doSetMediaTime(Time now)
Called from setMediaTime. |
protected float |
doSetRate(float factor)
|
protected void |
doStart()
Invoked by start() or syncstart(). |
protected void |
doStop()
The stop() method calls doStop() so that subclasses can add additional behavior. |
void |
downloadUpdate()
|
java.lang.String |
getContentType()
|
java.util.Vector |
getControllerList()
Return the list of BasicControllers supported by this Player. |
java.awt.Component |
getControlPanelComponent()
Get the Component with the default user interface for controlling this player. |
Control[] |
getControls()
Return the list of controls from its slave controllers plus the ones that this player supports. |
Time |
getDuration()
Get the duration of the movie. |
GainControl |
getGainControl()
Get the object for controlling audio gain. |
protected abstract TimeBase |
getMasterTimeBase()
This should be implemented by the subclass. |
MediaLocator |
getMediaLocator()
|
protected javax.media.protocol.DataSource |
getSource()
Get the DataSource used by this player. |
Time |
getStartLatency()
Gets the Controller's start latency in nanoseconds. |
java.awt.Component |
getVisualComponent()
Get the Component this player will output its visual media to. |
boolean |
isAboutToRestart()
Return true if the player is about to restart again. |
protected boolean |
isConfigurable()
A player is not configurable. |
boolean |
isFramePositionable()
Will return true if the player can do frame positioning. |
protected void |
manageController(Controller controller)
Add a Controller to the list of Controllers under this Player's management. |
protected void |
manageController(Controller controller,
boolean optional)
Add a Controller to the list of Controllers under this Player's management. |
protected void |
processEndOfMedia()
|
protected void |
processEvent(ControllerEvent evt)
|
void |
removeController(Controller oldController)
Stop controlling a Controller. |
protected void |
setMediaLength(long t)
Set the upper bound of the media time. |
void |
setMediaTime(Time now)
Loops through the list of controllers maintained by this player and invoke setMediaTime on each of them. |
float |
setRate(float rate)
Set the playback rate on the player. |
void |
setSource(javax.media.protocol.DataSource source)
Set the DataSource that provides the media for this player. |
void |
setStopTime(Time t)
Sets the media time at which you want the Clock
to stop. |
void |
setTimeBase(TimeBase tb)
Assigns a timebase for the player. |
protected void |
slaveToMasterTimeBase(TimeBase tb)
Slave all the controllers to the master time base. |
void |
start()
Start the Player as soon as possible. |
void |
stop()
Stop the player. |
protected void |
stopAtTime()
Stop because stop time has been reached. |
void |
syncStart(Time tbt)
Start at the given time base time. |
void |
unmanageController(Controller controller)
Remove a Controller from the list of Controllers under this Player's management. |
protected void |
updateDuration()
|
abstract void |
updateStats()
This is being called from a looping thread to update the stats. |
protected abstract boolean |
videoEnabled()
Return true if the player is currently playing media with a video track. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 从接口 javax.media.Controller 继承的方法 |
|---|
addControllerListener, close, deallocate, getControl, getState, getTargetState, prefetch, realize, removeControllerListener |
| 从接口 javax.media.Clock 继承的方法 |
|---|
getMediaNanoseconds, getMediaTime, getRate, getStopTime, getSyncTime, getTimeBase, mapToTimeBase |
| 字段详细信息 |
|---|
public static java.lang.String VERSION
protected javax.media.protocol.DataSource source
protected java.util.Vector controllerList
protected boolean framePositioning
protected Control[] controls
protected java.awt.Component controlComp
public com.sun.media.controls.SliderRegionControl regionControl
protected CachingControl cachingControl
protected ExtendedCachingControl extendedCachingControl
protected javax.media.control.BufferControl bufferControl
| 构造方法详细信息 |
|---|
public BasicPlayer()
| 方法详细信息 |
|---|
public boolean isFramePositionable()
protected boolean isConfigurable()
BasicController 中的 isConfigurable
public void setSource(javax.media.protocol.DataSource source)
throws java.io.IOException,
IncompatibleSourceException
MediaHandler 中的 setSourcesource - of media for this player.
java.io.IOException - thrown when an i/o error occurs
in reading information from the data source.
IncompatibleSourceException - thrown if the Player
can't use this source.public void downloadUpdate()
DownloadProgressListener 中的 downloadUpdatepublic MediaLocator getMediaLocator()
public java.lang.String getContentType()
protected javax.media.protocol.DataSource getSource()
protected void doClose()
BasicController 中的 doClose
public void setTimeBase(TimeBase tb)
throws IncompatibleTimeBaseException
Clock 中的 setTimeBaseBasicController 中的 setTimeBasetb - time base to be used by the Player.
IncompatibleTimeBaseException - thrown when a time base other
than the master time base is set when audio is enabled.protected void setMediaLength(long t)
BasicController 中的 setMediaLengthduration - the duration in nanoseconds.public Time getDuration()
Duration 中的 getDurationBasicController 中的 getDurationprotected void updateDuration()
public Time getStartLatency()
Controller 复制的描述Controller's start latency in nanoseconds. The start latency represents a
worst-case estimate of the amount of time it will take
to present the first frame of data.
This method is useful for determining how far in advance the
syncStart method must be invoked to ensure
that media will be
rendered at the specified start time.
For a Controller that has a variable start latency,
the value returned represents the maximum possible
start latency. If you call getStartLatency on a Controller that isn't Prefetched
and getStartLatency returns LATENCY_UNKNOWN, calling
prefetch and then calling getStartLatency again after the Controller posts
a PrefetchCompleteEvent might
return a more accurate estimate.
If getStartLatency still returns LATENCY_UNKNOWN,
the start latency is indeterminate and you might not be able to use
syncStart to
synchronize the Controller with other Controllers.
Note: In most cases, the value returned by
getStartLatency will change once the
Controller is Prefetched.
Controller 中的 getStartLatencyBasicController 中的 getStartLatencyprotected void stopAtTime()
BasicController 中的 stopAtTimeprotected void controllerStopAtTime()
public void setStopTime(Time t)
Clock 复制的描述Clock
to stop.
The Clock will stop when its media time
passes the stop-time.
To clear the stop time, set it to: Clock.RESET.
You can always call setStopTime on a Stopped
Clock.
On a Started Clock, the stop-time can only
be set once.
A StopTimeSetError is thrown if setStopTime
is called and the media stop-time has already been set.
Clock 中的 setStopTimeBasicController 中的 setStopTimet - The time at which you want the
Clock to stop, in media time.protected void controllerSetStopTime(Time t)
public final void setMediaTime(Time now)
Clock 中的 setMediaTimeBasicController 中的 setMediaTimenow - the target media time.public boolean isAboutToRestart()
protected void doSetMediaTime(Time now)
BasicController 中的 doSetMediaTimenow - the target media time.public java.awt.Component getVisualComponent()
Player 中的 getVisualComponentpublic java.awt.Component getControlPanelComponent()
Player 中的 getControlPanelComponentpublic GainControl getGainControl()
Player 中的 getGainControlpublic Control[] getControls()
Controller 中的 getControlsBasicController 中的 getControlspublic final void controllerUpdate(ControllerEvent evt)
ControllerListener 中的 controllerUpdateevt - The event generated.public final java.util.Vector getControllerList()
public final void start()
This is a "final" method. Subclasses should override doStart() to implement its own specific behavior.
Player 中的 startpublic final void syncStart(Time tbt)
This is a "final" method. Subclasses should override doStart() to implement its own specific behavior.
Clock 中的 syncStartBasicController 中的 syncStarttbt - the time base time to start the player.protected void doStart()
BasicController 中的 doStartprotected void doStop()
BasicController 中的 doStoppublic final void stop()
Clock 中的 stopBasicController 中的 stopprotected final void processEndOfMedia()
protected final void manageController(Controller controller)
protected final void manageController(Controller controller,
boolean optional)
public final void unmanageController(Controller controller)
public void addController(Controller newController)
throws IncompatibleTimeBaseException
Note: It is undefined what will happen if a Controller is under the control of a Player and any of the Controller's methods are called outside of the controlling Player.
Player 中的 addControllernewController - the Controller this
Player will control.
IncompatibleTimeBaseException - thrown if the new controller
will not accept the player's timebase.public final void removeController(Controller oldController)
Player 中的 removeControlleroldController - the Controller to stop controlling.protected abstract boolean audioEnabled()
protected abstract boolean videoEnabled()
protected abstract TimeBase getMasterTimeBase()
protected boolean doConfigure()
BasicController 中的 doConfigureprotected void completeConfigure()
BasicController 中的 completeConfigureprotected void doFailedConfigure()
BasicController 中的 doFailedConfigureprotected boolean doRealize()
BasicController 中的 doRealizeprotected void completeRealize()
BasicController 中的 completeRealizeprotected void doFailedRealize()
BasicController 中的 doFailedRealizeprotected void completePrefetch()
BasicController 中的 completePrefetchprotected void doFailedPrefetch()
BasicController 中的 doFailedPrefetchprotected final void abortRealize()
BasicController 中的 abortRealizeprotected boolean doPrefetch()
BasicController 中的 doPrefetchprotected final void abortPrefetch()
BasicController 中的 abortPrefetchprotected boolean deviceBusy(BasicController mc)
protected void slaveToMasterTimeBase(TimeBase tb)
throws IncompatibleTimeBaseException
tb - the time base to be used by all controllers.
IncompatibleTimeBaseException - thrown if any controller
will not accept the player's timebase.protected void processEvent(ControllerEvent evt)
protected float doSetRate(float factor)
BasicController 中的 doSetRatepublic float setRate(float rate)
Clock 中的 setRateBasicController 中的 setRaterate - The temporal scale factor (rate) to set.
public abstract void updateStats()
|
|||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||