|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.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
中的 setSource
source
- 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
中的 downloadUpdate
public 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
中的 setTimeBase
BasicController
中的 setTimeBase
tb
- 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
中的 setMediaLength
duration
- the duration in nanoseconds.public Time getDuration()
Duration
中的 getDuration
BasicController
中的 getDuration
protected 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
中的 getStartLatency
BasicController
中的 getStartLatency
protected void stopAtTime()
BasicController
中的 stopAtTime
protected 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
中的 setStopTime
BasicController
中的 setStopTime
t
- 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
中的 setMediaTime
BasicController
中的 setMediaTime
now
- the target media time.public boolean isAboutToRestart()
protected void doSetMediaTime(Time now)
BasicController
中的 doSetMediaTime
now
- the target media time.public java.awt.Component getVisualComponent()
Player
中的 getVisualComponent
public java.awt.Component getControlPanelComponent()
Player
中的 getControlPanelComponent
public GainControl getGainControl()
Player
中的 getGainControl
public Control[] getControls()
Controller
中的 getControls
BasicController
中的 getControls
public final void controllerUpdate(ControllerEvent evt)
ControllerListener
中的 controllerUpdate
evt
- 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
中的 start
public final void syncStart(Time tbt)
This is a "final" method. Subclasses should override doStart() to implement its own specific behavior.
Clock
中的 syncStart
BasicController
中的 syncStart
tbt
- the time base time to start the player.protected void doStart()
BasicController
中的 doStart
protected void doStop()
BasicController
中的 doStop
public final void stop()
Clock
中的 stop
BasicController
中的 stop
protected 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
中的 addController
newController
- 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
中的 removeController
oldController
- the Controller to stop controlling.protected abstract boolean audioEnabled()
protected abstract boolean videoEnabled()
protected abstract TimeBase getMasterTimeBase()
protected boolean doConfigure()
BasicController
中的 doConfigure
protected void completeConfigure()
BasicController
中的 completeConfigure
protected void doFailedConfigure()
BasicController
中的 doFailedConfigure
protected boolean doRealize()
BasicController
中的 doRealize
protected void completeRealize()
BasicController
中的 completeRealize
protected void doFailedRealize()
BasicController
中的 doFailedRealize
protected void completePrefetch()
BasicController
中的 completePrefetch
protected void doFailedPrefetch()
BasicController
中的 doFailedPrefetch
protected final void abortRealize()
BasicController
中的 abortRealize
protected boolean doPrefetch()
BasicController
中的 doPrefetch
protected final void abortPrefetch()
BasicController
中的 abortPrefetch
protected 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
中的 doSetRate
public float setRate(float rate)
Clock
中的 setRate
BasicController
中的 setRate
rate
- The temporal scale factor (rate) to set.
public abstract void updateStats()
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |