public final class VideoStream extends RasterStream implements IDisposable
Constructor and Description |
---|
VideoStream(String uri)
Initializes the video stream from a Uri, which can be a file, HTTP, RTP, UDP, or TCP source.
|
VideoStream(URI uri)
Initializes the video stream from a Uri, which can be a file, HTTP, RTP, UDP, or TCP source.
|
Modifier and Type | Method and Description |
---|---|
void |
closeStreamAndResources()
Closes the video stream and any associated resources.
|
protected void |
dispose(boolean disposing) |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
boolean |
getAllowFrameDrop()
Gets a value indicating if frames should be dropped if video processing can not keep up with a video stream.
|
int |
getEndFrame()
Gets the end frame of the video.
|
double |
getEndTime()
Gets the end time of the video in seconds.
|
double |
getFrameRate()
Gets the frame rate of the video when the
Playback property is set to
RealTime . |
JulianDate |
getIntervalEndTime()
Gets the
SceneManager time at which the video
will stop playing when the Playback property is set to videoplayback.TimeInterval . |
JulianDate |
getIntervalStartTime()
Gets the
SceneManager time at which the video
will begin playing when the Playback property is set to videoplayback.TimeInterval . |
boolean |
getIsPlaying()
Gets whether or not the video is playing.
|
boolean |
getLoop()
Gets whether the video will loop when it reaches its last frame when the
Playback
property is set to RealTime . |
int |
getPacketAcquirementYieldTime()
Gets the thread processing yield time for asynchronous streaming of video over common protocols like udp.
|
int |
getPacketBufferLimit()
Gets a value indicating the buffering limit for packets when processing a video stream.
|
VideoPlayback |
getPlayback()
Gets the
VideoPlayback mode of the video. |
int |
getStartFrame()
Gets the start frame of the video.
|
double |
getStartTime()
Gets the start time of the video in seconds.
|
URI |
getUri()
Gets the
URI of the video. |
void |
pause()
Pauses the video when the
Playback property is set to
RealTime . |
void |
play()
Begins playing the video when the
Playback property is set to
RealTime . |
void |
reinitializeWithStringUri(String uri)
Reinitializes the video stream from a Uri, which can be a file, HTTP, RTP, UDP, or TCP source.
|
void |
reset()
Seeks the video to its first frame and begins playing the video when the
Playback
property is set to RealTime . |
void |
setAllowFrameDrop(boolean allow)
Sets a value indicating if frames should be dropped if video processing can not keep up with a video stream.
|
void |
setEndFrame(int value)
Sets the end frame of the video.
|
void |
setEndTime(double value)
Sets the end time of the video in seconds.
|
void |
setFrameRate(double value)
Sets the frame rate of the video when the
Playback property is set to
RealTime . |
void |
setIntervalEndTime(JulianDate value)
Sets the
SceneManager time at which the video
will stop playing when the Playback property is set to videoplayback.TimeInterval . |
void |
setIntervalStartTime(JulianDate value)
Sets the
SceneManager time at which the video
will begin playing when the Playback property is set to videoplayback.TimeInterval . |
void |
setLoop(boolean value)
Sets whether the video will loop when it reaches its last frame when the
Playback
property is set to RealTime . |
void |
setPacketAcquirementYieldTime(int newPacketAquirementSleepTime)
Sets the thread processing yield time for asynchronous streaming of video over common protocols like udp.
|
void |
setPacketBufferLimit(int newPacketAquirementSleepTime)
Sets a value indicating the buffering limit for packets when processing a video stream.
|
void |
setPlayback(VideoPlayback value)
Sets the
VideoPlayback mode of the video. |
void |
setStartFrame(int value)
Sets the start frame of the video.
|
void |
setStartTime(double value)
Sets the start time of the video in seconds.
|
void |
stop()
Stops the video when the
Playback property is set to
RealTime . |
boolean |
update(JulianDate time,
JulianDate nextTime)
When overridden in a derived class, updates the raster data associated with the raster stream at the specified time.
|
getUpdateDelta, setUpdateDelta
apply, applyInPlace, copyFromBitmap, copyFromMemory, copyFromRaster, dispose, extractBand, extractBand, flip, getAttributes, getHeight, getWidth, rotate, setAttributes, toBitmap
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, dispose
public VideoStream(URI uri)
uri
- The URI
of the video.public VideoStream(String uri)
uri
- The Uri of the video.protected void finalize() throws Throwable
java.lang.Object
finalize
method to dispose of
system resources or to perform other cleanup.
The general contract of finalize
is that it is invoked
if and when the Java™ virtual
machine has determined that there is no longer any
means by which this object can be accessed by any thread that has
not yet died, except as a result of an action taken by the
finalization of some other object or class which is ready to be
finalized. The finalize
method may take any action, including
making this object available again to other threads; the usual purpose
of finalize
, however, is to perform cleanup actions before
the object is irrevocably discarded. For example, the finalize method
for an object that represents an input/output connection might perform
explicit I/O transactions to break the connection before the object is
permanently discarded.
The finalize
method of class Object
performs no
special action; it simply returns normally. Subclasses of
Object
may override this definition.
The Java programming language does not guarantee which thread will
invoke the finalize
method for any given object. It is
guaranteed, however, that the thread that invokes finalize will not
be holding any user-visible synchronization locks when finalize is
invoked. If an uncaught exception is thrown by the finalize method,
the exception is ignored and finalization of that object terminates.
After the finalize
method has been invoked for an object, no
further action is taken until the Java virtual machine has again
determined that there is no longer any means by which this object can
be accessed by any thread that has not yet died, including possible
actions by other objects or classes which are ready to be finalized,
at which point the object may be discarded.
The finalize
method is never invoked more than once by a Java
virtual machine for any given object.
Any exception thrown by the finalize
method causes
the finalization of this object to be halted, but is otherwise
ignored.
finalize
in class Raster
Throwable
- the Exception
raised by this methodWeakReference
,
PhantomReference
protected void dispose(boolean disposing)
dispose
in class RasterStream
public final VideoPlayback getPlayback()
VideoPlayback
mode of the video.public final void setPlayback(VideoPlayback value)
VideoPlayback
mode of the video.public final double getFrameRate()
Playback
property is set to
RealTime
.
If this property is not set, the internal framerate of the video is used.public final void setFrameRate(double value)
Playback
property is set to
RealTime
.
If this property is not set, the internal framerate of the video is used.public final JulianDate getIntervalStartTime()
SceneManager
time at which the video
will begin playing when the Playback
property is set to videoplayback.TimeInterval
.public final void setIntervalStartTime(JulianDate value)
SceneManager
time at which the video
will begin playing when the Playback
property is set to videoplayback.TimeInterval
.public final JulianDate getIntervalEndTime()
SceneManager
time at which the video
will stop playing when the Playback
property is set to videoplayback.TimeInterval
.public final void setIntervalEndTime(JulianDate value)
SceneManager
time at which the video
will stop playing when the Playback
property is set to videoplayback.TimeInterval
.public final double getStartTime()
StartTime
property also
changes the StartFrame
property to the frame in the video that corresponds to the specified time.public final void setStartTime(double value)
StartTime
property also
changes the StartFrame
property to the frame in the video that corresponds to the specified time.public final double getEndTime()
EndTime
property also
changes the EndFrame
property to the frame in the video that corresponds to the specified time.public final void setEndTime(double value)
EndTime
property also
changes the EndFrame
property to the frame in the video that corresponds to the specified time.public final int getStartFrame()
StartFrame
property also
changes the StartTime
property to the time in the video that corresponds to the specified frame.public final void setStartFrame(int value)
StartFrame
property also
changes the StartTime
property to the time in the video that corresponds to the specified frame.public final int getEndFrame()
EndFrame
property also
changes the EndTime
property to the time in the video that corresponds to the specified frame.public final void setEndFrame(int value)
EndFrame
property also
changes the EndTime
property to the time in the video that corresponds to the specified frame.public final boolean getLoop()
Playback
property is set to RealTime
.public final void setLoop(boolean value)
Playback
property is set to RealTime
.public final boolean getIsPlaying()
Play
, Pause
,
Stop
, and Reset
methods to control the playback of the video when the
Playback
property is set to
RealTime
.public final int getPacketAcquirementYieldTime()
public final void setPacketAcquirementYieldTime(int newPacketAquirementSleepTime)
public final int getPacketBufferLimit()
public final void setPacketBufferLimit(int newPacketAquirementSleepTime)
public final boolean getAllowFrameDrop()
public final void setAllowFrameDrop(boolean allow)
public final void reinitializeWithStringUri(String uri)
uri
- The Uri of the video.public final void play()
Playback
property is set to
RealTime
.public final void pause()
Playback
property is set to
RealTime
.public final void stop()
Playback
property is set to
RealTime
. Stopping the video will
seek to the first frame and pause playback. Use the Play
method to begin playing the video again.public final void reset()
Playback
property is set to RealTime
.public final void closeStreamAndResources()
public boolean update(JulianDate time, JulianDate nextTime)
RasterStream
Update
method is called, the raster stream contains a raster data buffer defined by the current
Attributes
(get
) of the stream for updating the raster data.
The time parameter provides the current and next SceneManager
time.
Return true if the raster data was updated, otherwise return false.update
in class RasterStream
time
- The current SceneManager
time.nextTime
- The next SceneManager
time.