Package com.jogamp.opengl.util
Class TimeFrameI
java.lang.Object
com.jogamp.opengl.util.TimeFrameI
- Direct Known Subclasses:
AudioSink.AudioFrame
,TextureSequence.TextureFrame
Integer time frame in milliseconds, maybe specialized for texture/video, audio, .. animated content.
Type and value range has been chosen to suit embedded CPUs
and characteristics of audio / video streaming and animations.
Milliseconds of type integer with a maximum value of Integer.MAX_VALUE
will allow tracking time up 2,147,483.647 seconds or
24 days 20 hours 31 minutes and 23 seconds.
Milliseconds granularity is also more than enough to deal with A-V synchronization, where the threshold usually lies within 22ms.
Milliseconds granularity for displaying video frames might seem inaccurate for each single frame, i.e. 60Hz != 16ms, however, accumulated values diminish this error and vertical sync is achieved by build-in V-Sync of the video drivers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Constant marking the end of the stream PTS, i.e.static final int
Constant marking an invalid PTS, i.e. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Get this frame's duration in milliseconds.final int
getPTS()
Get this frame's presentation timestamp (PTS) in milliseconds.final void
setDuration
(int duration) Set this frame's duration in milliseconds.final void
setPTS
(int pts) Set this frame's presentation timestamp (PTS) in milliseconds.toString()
-
Field Details
-
INVALID_PTS
public static final int INVALID_PTSConstant marking an invalid PTS, i.e. Integer.MIN_VALUE == 0x80000000 == -2147483648. Sync w/ native code.- See Also:
-
END_OF_STREAM_PTS
public static final int END_OF_STREAM_PTSConstant marking the end of the stream PTS, i.e. Integer.MIN_VALUE - 1 == 0x7FFFFFFF == 2147483647. Sync w/ native code.- See Also:
-
-
Constructor Details
-
TimeFrameI
public TimeFrameI() -
TimeFrameI
public TimeFrameI(int pts, int duration)
-
-
Method Details
-
getPTS
public final int getPTS()Get this frame's presentation timestamp (PTS) in milliseconds. -
setPTS
public final void setPTS(int pts) Set this frame's presentation timestamp (PTS) in milliseconds. -
getDuration
public final int getDuration()Get this frame's duration in milliseconds. -
setDuration
public final void setDuration(int duration) Set this frame's duration in milliseconds. -
toString
-