SpeedChangeEffect
@UnstableApi
class SpeedChangeEffect : GlEffect
Applies a speed change by updating the frame timestamps.
This effect doesn't drop any frames.
This effect is not supported for effects previewing.
Summary
Public constructors |
---|
SpeedChangeEffect(speed: @FloatRange(from = 0, fromInclusive = false) Float) Creates an instance that applies the same |
SpeedChangeEffect(speedProvider: SpeedProvider!) Creates an instance. |
Public functions |
|
---|---|
Long |
getDurationAfterEffectApplied(durationUs: Long) Returns the expected duration of the output stream when the effect is applied given a input |
Boolean |
Returns whether a |
GlShaderProgram! |
toGlShaderProgram(context: Context!, useHdr: Boolean) Returns a |
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 |
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.
toGlShaderProgram
fun toGlShaderProgram(context: Context!, useHdr: Boolean): GlShaderProgram!
Returns a GlShaderProgram
that applies the effect.
Parameters | |
---|---|
context: Context! |
A |
useHdr: Boolean |
Whether input textures come from an HDR source. If |
Throws | |
---|---|
androidx.media3.common.VideoFrameProcessingException |
If an error occurs while creating the . |