GlTextureFrame.Builder


class GlTextureFrame.Builder


A builder for GlTextureFrame instances.

Summary

Public constructors

Builder(
    glTextureInfo: GlTextureInfo!,
    releaseTextureExecutor: Executor!,
    releaseTextureCallback: Consumer<GlTextureInfo!>!
)

Creates a new Builder.

Public constructors

Builder

Builder(
    glTextureInfo: GlTextureInfo!,
    releaseTextureExecutor: Executor!,
    releaseTextureCallback: Consumer<GlTextureInfo!>!
)

Creates a new Builder.

Parameters
glTextureInfo: GlTextureInfo!

The GlTextureInfo to wrap.

releaseTextureExecutor: Executor!

The Executor on which the releaseTextureCallback is called.

releaseTextureCallback: Consumer<GlTextureInfo!>!

The Consumer to call to release the texture.

Public functions

build

fun build(): GlTextureFrame!

Builds the GlTextureFrame instance.

setFenceSync

@CanIgnoreReturnValue
fun setFenceSync(fenceSync: Long): GlTextureFrame.Builder!

Sets the fenceSync.

The default value is GL_FENCE_SYNC_UNSET.

The consumer of the frame is expected to wait on this fence (e.g. using glWaitSync or glClientWaitSync) to ensure the texture content is fully written before reading it.

Parameters
fenceSync: Long

The OpenGL fence sync object.

setFormat

@CanIgnoreReturnValue
fun setFormat(format: Format!): GlTextureFrame.Builder!

Sets the format.

setPresentationTimeUs

@CanIgnoreReturnValue
fun setPresentationTimeUs(presentationTimeUs: Long): GlTextureFrame.Builder!

Sets the presentationTimeUs.

setReleaseTimeNs

@CanIgnoreReturnValue
fun setReleaseTimeNs(releaseTimeNs: Long): GlTextureFrame.Builder!

Sets the releaseTimeNs.