GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.av.PTS Class Reference

Presentation Timestamp (PTS) with added System Clock Reference (SCR) via set(long, int) and its interpolation via get(long), as well as giving raw access via getLast(). More...

Collaboration diagram for com.jogamp.common.av.PTS:

Classes

interface  FloatValue
 An external float value getter. More...
 

Public Member Functions

 PTS (final FloatValue speed)
 Create new instance, initializing pts with TimeFrameI#INVALID_PTS and system-clock timestamp with zero. More...
 
 PTS (final FloatValue speed, final long scr, final int pts)
 Create new instance. More...
 
 PTS (final PTS other)
 Copy constructor. More...
 
boolean isValid ()
 Returns true if getLast() is unequal to TimeFrameI#INVALID_PTS. More...
 
boolean isEOS ()
 Returns true if getLast() equals to TimeFrameI#END_OF_STREAM_PTS, indicating end of stream (EOS). More...
 
long getSCR ()
 Returns the System Clock Reference (SCR) in milliseconds of last PTS update via set(long, int). More...
 
String getSCRTimeStr (final boolean addFractions)
 Returns getSCR() as time string representation via toTimeStr(long, boolean). More...
 
int getLast ()
 Returns the last updated PTS value via set(long, int) w/o System Clock Reference (SCR) interpolation. More...
 
String getLastTimeStr (final boolean addFractions)
 Returns getLast() as time string representation via toTimeStr(long, boolean). More...
 
float getSpeed ()
 Returns the external playback speed. More...
 
void set (final long scr, final int pts)
 Updates the PTS value with given System Clock Reference (SCR) in milliseconds. More...
 
void setPTS (final int pts)
 Sets the PTS value, see set(long, int). More...
 
void setSCR (final long currentMillis)
 Sets the System Clock Reference (SCR) in milliseconds of last PTS update, see set(long, int). More...
 
void set (final PTS other)
 Updates the PTS value with values from other PTS instance. More...
 
int get (final long currentMillis)
 Returns the last updated PTS, interpolated by System Clock Reference (SCR) delta to given currentMillis and playback speed. More...
 
int getCurrent ()
 Returns get(long) passing Clock#currentMillis(). More...
 
String getTimeStr (final long currentMillis, final boolean addFractions)
 Returns get(long) as time string representation via toTimeStr(long, boolean). More...
 
int diffLast (final PTS rhs)
 Returns getLast() - rhs. More...
 
int diff (final long currentMillis, final PTS rhs)
 Returns get(long) - rhs. More...
 
String toString ()
 
String toString (final long currentMillis)
 

Static Public Member Functions

static String toTimeStr (final long millis, final boolean addFractions)
 Returns a time string representation '[HH:]mm:ss[.SSS]', dropping unused hour quantities and fractions of seconds optionally. More...
 
static String toTimeStr (final long millis)
 Returns a full time string representation 'HH:mm:ss.SSS'. More...
 
static int toMillis (final String v, final boolean throwException)
 Returns milliseconds from given string representation in '[H[H]:]m[m]:s[s][.S*]'. More...
 
static int toMillis (final String v)
 Returns milliseconds from given string representation in '[H[H]:]m[m]:s[s][.S*]' or -1 for parsing error. More...
 

Detailed Description

Presentation Timestamp (PTS) with added System Clock Reference (SCR) via set(long, int) and its interpolation via get(long), as well as giving raw access via getLast().

The relative millisecond PTS since start of the presentation stored in integer covers a time span of 2'147'483'647 ms (see Integer#MAX_VALUE or 2'147'483 seconds or 24.855 days.

Definition at line 46 of file PTS.java.

Constructor & Destructor Documentation

◆ PTS() [1/3]

com.jogamp.common.av.PTS.PTS ( final FloatValue  speed)

Create new instance, initializing pts with TimeFrameI#INVALID_PTS and system-clock timestamp with zero.

Parameters
speedexternal FloatValue getter for playback speed.
See also
set(long, int)

Definition at line 62 of file PTS.java.

◆ PTS() [2/3]

com.jogamp.common.av.PTS.PTS ( final FloatValue  speed,
final long  scr,
final int  pts 
)

Create new instance.

Parameters
speedexternal FloatValue getter for playback speed.
scrSystem Clock Reference (SCR) in milliseconds of taken pts value, i.e. Clock#currentMillis().
ptsthe presentation timestamp (PTS) in milliseconds
See also
set(long, int)

Definition at line 74 of file PTS.java.

◆ PTS() [3/3]

com.jogamp.common.av.PTS.PTS ( final PTS  other)

Copy constructor.

Definition at line 79 of file PTS.java.

Member Function Documentation

◆ diff()

int com.jogamp.common.av.PTS.diff ( final long  currentMillis,
final PTS  rhs 
)

Returns get(long) - rhs.

get(long).

Definition at line 155 of file PTS.java.

Here is the call graph for this function:

◆ diffLast()

int com.jogamp.common.av.PTS.diffLast ( final PTS  rhs)

Returns getLast() - rhs.

getLast().

Definition at line 150 of file PTS.java.

Here is the call graph for this function:

◆ get()

int com.jogamp.common.av.PTS.get ( final long  currentMillis)

Returns the last updated PTS, interpolated by System Clock Reference (SCR) delta to given currentMillis and playback speed.

     last_pts + (int) ( ( currentMillis - SCR ) * speed + 0.5f )
Parameters
currentMilliscurrent system clock in milliseconds, i.e. Clock#currentMillis().
See also
set(long, int)

Definition at line 138 of file PTS.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrent()

int com.jogamp.common.av.PTS.getCurrent ( )

Returns get(long) passing Clock#currentMillis().

Definition at line 142 of file PTS.java.

Here is the call graph for this function:

◆ getLast()

int com.jogamp.common.av.PTS.getLast ( )

Returns the last updated PTS value via set(long, int) w/o System Clock Reference (SCR) interpolation.

Definition at line 97 of file PTS.java.

Here is the caller graph for this function:

◆ getLastTimeStr()

String com.jogamp.common.av.PTS.getLastTimeStr ( final boolean  addFractions)

Returns getLast() as time string representation via toTimeStr(long, boolean).

Definition at line 99 of file PTS.java.

Here is the call graph for this function:

◆ getSCR()

long com.jogamp.common.av.PTS.getSCR ( )

Returns the System Clock Reference (SCR) in milliseconds of last PTS update via set(long, int).

Definition at line 91 of file PTS.java.

Here is the caller graph for this function:

◆ getSCRTimeStr()

String com.jogamp.common.av.PTS.getSCRTimeStr ( final boolean  addFractions)

Returns getSCR() as time string representation via toTimeStr(long, boolean).

Definition at line 93 of file PTS.java.

Here is the call graph for this function:

◆ getSpeed()

float com.jogamp.common.av.PTS.getSpeed ( )

Returns the external playback speed.

Definition at line 104 of file PTS.java.

Here is the call graph for this function:

◆ getTimeStr()

String com.jogamp.common.av.PTS.getTimeStr ( final long  currentMillis,
final boolean  addFractions 
)

Returns get(long) as time string representation via toTimeStr(long, boolean).

Definition at line 145 of file PTS.java.

Here is the call graph for this function:

◆ isEOS()

boolean com.jogamp.common.av.PTS.isEOS ( )

Returns true if getLast() equals to TimeFrameI#END_OF_STREAM_PTS, indicating end of stream (EOS).

Definition at line 88 of file PTS.java.

◆ isValid()

boolean com.jogamp.common.av.PTS.isValid ( )

Returns true if getLast() is unequal to TimeFrameI#INVALID_PTS.

Definition at line 85 of file PTS.java.

◆ set() [1/2]

void com.jogamp.common.av.PTS.set ( final long  scr,
final int  pts 
)

Updates the PTS value with given System Clock Reference (SCR) in milliseconds.

Parameters
scrSystem Clock Reference (SCR) in milliseconds of taken PTS value, i.e. Clock#currentMillis().
ptsthe presentation timestamp (PTS) in milliseconds

Definition at line 111 of file PTS.java.

◆ set() [2/2]

void com.jogamp.common.av.PTS.set ( final PTS  other)

Updates the PTS value with values from other PTS instance.

Parameters
othersource PTS values
See also
get(long)

Definition at line 125 of file PTS.java.

◆ setPTS()

void com.jogamp.common.av.PTS.setPTS ( final int  pts)

Sets the PTS value, see set(long, int).

Definition at line 116 of file PTS.java.

◆ setSCR()

void com.jogamp.common.av.PTS.setSCR ( final long  currentMillis)

Sets the System Clock Reference (SCR) in milliseconds of last PTS update, see set(long, int).

Definition at line 118 of file PTS.java.

◆ toMillis() [1/2]

static int com.jogamp.common.av.PTS.toMillis ( final String  v)
static

Returns milliseconds from given string representation in '[H[H]:]m[m]:s[s][.S*]' or -1 for parsing error.

Definition at line 232 of file PTS.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toMillis() [2/2]

static int com.jogamp.common.av.PTS.toMillis ( final String  v,
final boolean  throwException 
)
static

Returns milliseconds from given string representation in '[H[H]:]m[m]:s[s][.S*]'.

Parameters
vthe timestamp string to parse.
throwExceptionif true, forwards DateTimeParseException to caller, otherwise return -1.

Definition at line 220 of file PTS.java.

◆ toString() [1/2]

String com.jogamp.common.av.PTS.toString ( )

Definition at line 160 of file PTS.java.

◆ toString() [2/2]

String com.jogamp.common.av.PTS.toString ( final long  currentMillis)

Definition at line 162 of file PTS.java.

◆ toTimeStr() [1/2]

static String com.jogamp.common.av.PTS.toTimeStr ( final long  millis)
static

Returns a full time string representation 'HH:mm:ss.SSS'.

Parameters
milliscomplete time in milliseconds
See also
toTimeStr(long, boolean)

Definition at line 205 of file PTS.java.

◆ toTimeStr() [2/2]

static String com.jogamp.common.av.PTS.toTimeStr ( final long  millis,
final boolean  addFractions 
)
static

Returns a time string representation '[HH:]mm:ss[.SSS]', dropping unused hour quantities and fractions of seconds optionally.

Parameters
milliscomplete time in milliseconds
addFractionstoggle for fractions of seconds
See also
toTimeStr(long)

Definition at line 170 of file PTS.java.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: