SpeedChangeEffect


@UnstableApi
class SpeedChangeEffect : GlEffect


Summary

Public constructors

SpeedChangeEffect(speed: @FloatRange(from = 0, fromInclusive = false) Float)

This function is deprecated. Deprecated in Java

This function is deprecated. Deprecated in Java

Public functions

Long

This function is deprecated. Deprecated in Java

Boolean
isNoOp(inputWidth: Int, inputHeight: Int)

This function is deprecated. Deprecated in Java

GlShaderProgram!
toGlShaderProgram(context: Context!, useHdr: Boolean)

This function is deprecated. Deprecated in Java

Public constructors

SpeedChangeEffect

SpeedChangeEffect(speed: @FloatRange(from = 0, fromInclusive = false) Float)

Creates an instance that applies the same speed change to all the timestamps.

SpeedChangeEffect

SpeedChangeEffect(speedProvider: SpeedProvider!)

Creates an instance.

Parameters
speedProvider: SpeedProvider!

The SpeedProvider specifying the speed changes. Applied on each stream assuming the first frame timestamp of the input media is 0.

Public functions

getDurationAfterEffectApplied

fun getDurationAfterEffectApplied(durationUs: Long): Long

Returns the expected duration of the output stream when the effect is applied given a input durationUs.

isNoOp

fun isNoOp(inputWidth: Int, inputHeight: Int): Boolean

Returns whether a GlEffect applies no change at every timestamp.

This can be used as a hint to skip this instance.

Parameters
inputWidth: Int

The input frame width, in pixels.

inputHeight: Int

The input frame height, in pixels.

toGlShaderProgram

fun toGlShaderProgram(context: Context!, useHdr: Boolean): GlShaderProgram!

Returns a GlShaderProgram that applies the effect.

Parameters
context: Context!

A Context.

useHdr: Boolean

Whether input textures come from an HDR source. If true, colors will be in linear RGB BT.2020. If false, colors will be in linear RGB BT.709.

Throws
androidx.media3.common.VideoFrameProcessingException

If an error occurs while creating the GlShaderProgram.