OverlayEffect


@UnstableApi
class OverlayEffect : GlEffect


Applies a list of TextureOverlays to a frame in FIFO order (the last overlay in the list is displayed on top).

Summary

Public constructors

Creates a new instance for the given list of TextureOverlays.

Public functions

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

Returns a GlShaderProgram that applies the effect.

Inherited functions

From androidx.media3.effect.GlEffect
Boolean
isNoOp(inputWidth: Int, inputHeight: Int)

Returns whether a GlEffect applies no change at every timestamp.

Public constructors

OverlayEffect

OverlayEffect(textureOverlays: ImmutableList<TextureOverlay!>!)

Creates a new instance for the given list of TextureOverlays.

Parameters
textureOverlays: ImmutableList<TextureOverlay!>!

The TextureOverlays to be blended into the frame.

Public functions

toGlShaderProgram

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

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 .