SingleFrameGlShaderProgram


@UnstableApi
abstract class SingleFrameGlShaderProgram : BaseGlShaderProgram


Manages a GLSL shader program for processing a frame. Implementations generally copy input pixels into an output frame, with changes to pixels specific to the implementation.

SingleFrameGlShaderProgram implementations must produce exactly one output frame per input frame with the same presentation timestamp. For more flexibility, implement directly.

All methods in this class must be called on the thread that owns the OpenGL context.

Summary

Public constructors

SingleFrameGlShaderProgram(useHighPrecisionColorComponents: Boolean)

Creates a SingleFrameGlShaderProgram instance.

Inherited functions

From androidx.media3.effect.BaseGlShaderProgram
abstract Size!
configure(inputWidth: Int, inputHeight: Int)

Configures the instance based on the input dimensions.

abstract Unit
drawFrame(inputTexId: Int, presentationTimeUs: Long)

Draws one frame.

Unit

Flushes the GlShaderProgram.

Unit
Unit
queueInputFrame(
    glObjectsProvider: GlObjectsProvider!,
    inputTexture: GlTextureInfo!,
    presentationTimeUs: Long
)

Processes an input frame if possible.

Unit

Releases all resources.

Unit

Notifies the GlShaderProgram that the frame on the given output texture is no longer used and can be overwritten.

Unit
setErrorListener(
    errorListenerExecutor: Executor!,
    errorListener: GlShaderProgram.ErrorListener!
)

Sets the ErrorListener.

Boolean

Returns true if the texture buffer should be cleared before calling drawFrame or false if it should retain the content of the last drawn frame.

Unit

Notifies the GlShaderProgram that no further input frames belonging to the current input stream will be queued.

From androidx.media3.effect.GlShaderProgram
abstract Unit
setErrorListener(
    executor: Executor!,
    errorListener: GlShaderProgram.ErrorListener!
)

Sets the ErrorListener.

Public constructors

SingleFrameGlShaderProgram

SingleFrameGlShaderProgram(useHighPrecisionColorComponents: Boolean)

Creates a SingleFrameGlShaderProgram instance.

Parameters
useHighPrecisionColorComponents: Boolean

If false, uses colors with 8-bit unsigned bytes. If true, use 16-bit (half-precision) floating-point.