GlTextureFrame.Builder


public final class GlTextureFrame.Builder


A builder for GlTextureFrame instances.

Summary

Public constructors

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

Creates a new Builder.

Public constructors

Builder

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

Creates a new Builder.

Parameters
GlTextureInfo glTextureInfo

The GlTextureInfo to wrap.

Executor releaseTextureExecutor

The Executor on which the releaseTextureCallback is called.

Consumer<GlTextureInfo> releaseTextureCallback

The Consumer to call to release the texture.

Public methods

build

public GlTextureFrame build()

Builds the GlTextureFrame instance.

setFenceSync

@CanIgnoreReturnValue
public GlTextureFrame.Builder setFenceSync(long fenceSync)

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
long fenceSync

The OpenGL fence sync object.

setFormat

@CanIgnoreReturnValue
public GlTextureFrame.Builder setFormat(Format format)

Sets the format.

setPresentationTimeUs

@CanIgnoreReturnValue
public GlTextureFrame.Builder setPresentationTimeUs(long presentationTimeUs)

Sets the presentationTimeUs.

setReleaseTimeNs

@CanIgnoreReturnValue
public GlTextureFrame.Builder setReleaseTimeNs(long releaseTimeNs)

Sets the releaseTimeNs.