SpeedProviderUtil
@UnstableApi
class SpeedProviderUtil
Utilities for SpeedProvider.
Summary
Public functions |
|
|---|---|
java-static Long |
getDurationAfterSpeedProviderApplied(Returns the duration of the output when the given |
java-static Long |
getNextSpeedChangeSamplePosition(Returns the sample position of the next speed change or |
java-static Float |
getSampleAlignedSpeed(Returns the speed at the specified sample position. |
Public functions
getDurationAfterSpeedProviderApplied
java-static fun getDurationAfterSpeedProviderApplied(
speedProvider: SpeedProvider!,
durationUs: Long
): Long
Returns the duration of the output when the given SpeedProvider is applied given an input stream with the given durationUs.
getNextSpeedChangeSamplePosition
java-static fun getNextSpeedChangeSamplePosition(
speedProvider: SpeedProvider!,
samplePosition: Long,
sampleRate: Int
): Long
Returns the sample position of the next speed change or INDEX_UNSET if none is set.
If the next speed change falls between sample boundaries, this method will return the next closest sample position, which ensures that speed regions stay consistent with getSampleAlignedSpeed.
getSampleAlignedSpeed
java-static fun getSampleAlignedSpeed(
speedProvider: SpeedProvider!,
samplePosition: Long,
sampleRate: Int
): Float
Returns the speed at the specified sample position.
This method is consistent with the alignment done by getNextSpeedChangeSamplePosition.