public final class PtsTimestampAdjuster extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DO_NOT_OFFSET
A special
firstSampleTimestampUs value indicating that presentation timestamps should
not be offset. |
Constructor and Description |
---|
PtsTimestampAdjuster(long firstSampleTimestampUs) |
Modifier and Type | Method and Description |
---|---|
long |
adjustTimestamp(long pts)
Scales and offsets an MPEG-2 TS presentation timestamp.
|
boolean |
isInitialized()
Whether this adjuster has been initialized with a first MPEG-2 TS presentation timestamp.
|
static long |
ptsToUs(long pts)
Converts a value in MPEG-2 timestamp units to the corresponding value in microseconds.
|
void |
reset()
Resets the instance to its initial state.
|
static long |
usToPts(long us)
Converts a value in microseconds to the corresponding values in MPEG-2 timestamp units.
|
public static final long DO_NOT_OFFSET
firstSampleTimestampUs
value indicating that presentation timestamps should
not be offset.public PtsTimestampAdjuster(long firstSampleTimestampUs)
firstSampleTimestampUs
- The desired result of the first call to
adjustTimestamp(long)
, or DO_NOT_OFFSET
if presentation timestamps
should not be offset.public void reset()
public boolean isInitialized()
public long adjustTimestamp(long pts)
pts
- The MPEG-2 TS presentation timestamp.public static long ptsToUs(long pts)
pts
- A value in MPEG-2 timestamp units.public static long usToPts(long us)
us
- A value in microseconds.