GlTextureFrame


@ExperimentalApi
public class GlTextureFrame


A frame that wraps a GlTextureInfo.

Summary

Nested types

public final class GlTextureFrame.Builder

A builder for GlTextureFrame instances.

Constants

static final GlTextureFrame

Public fields

final long

The OpenGL fence sync object (a createGlSyncFence handle) associated with this frame.

final Format

The format of the frame.

final GlTextureInfo

The GlTextureInfo.

final ImmutableMap<StringObject>
final long

The presentation time of the frame, in microseconds.

final Consumer<GlTextureInfo>

The Consumer to call to release the texture.

final Executor

The Executor on which the releaseTextureCallback is called.

final long

The release time of the frame, in nanoseconds.

Public methods

GlTextureFrame.Builder

Returns a Builder initialized with the values of this instance.

ImmutableMap<StringObject>
void

Releases the frame and its underlying resources.

void

Increases the reference count of this frame.

Constants

END_OF_STREAM_FRAME

public static final GlTextureFrame END_OF_STREAM_FRAME

Public fields

fenceSync

public final long fenceSync

The OpenGL fence sync object (a createGlSyncFence handle) associated with this frame. See

If this texture is read in an OpenGL context different to the one it was written to, call awaitSyncObject on this fence before reading the glTextureInfo, to ensure the contents have been fully written to.

Callers must *not* delete this fence, as it may be reused up until this frame is released.

The value is GL_FENCE_SYNC_UNSET if no fence has been created for this texture, as it is only expected to be produced and consumed within the same GL command stream.

format

public final Format format

The format of the frame.

glTextureInfo

public final GlTextureInfo glTextureInfo

The GlTextureInfo.

metadata

public final ImmutableMap<StringObjectmetadata

presentationTimeUs

public final long presentationTimeUs

The presentation time of the frame, in microseconds.

releaseTextureCallback

public final Consumer<GlTextureInforeleaseTextureCallback

The Consumer to call to release the texture.

releaseTextureExecutor

public final Executor releaseTextureExecutor

The Executor on which the releaseTextureCallback is called.

releaseTimeNs

public final long releaseTimeNs

The release time of the frame, in nanoseconds.

Public methods

buildUpon

public GlTextureFrame.Builder buildUpon()

Returns a Builder initialized with the values of this instance.

getMetadata

public ImmutableMap<StringObjectgetMetadata()

release

public void release(@Nullable SyncFenceWrapper releaseFence)

Releases the frame and its underlying resources.

This implementation is idempotent if called after the frame has already been released. It will strictly release the underlying resources only when the count transitions from 1 to 0.

Parameters
@Nullable SyncFenceWrapper releaseFence

A SyncFenceWrapper that must signal before the underlying resources can be fully released, or null if the resources can be released immediately.

retain

public void retain()

Increases the reference count of this frame. For every call to this method there must be an extra release call before this frame is released.

Throws
java.lang.IllegalStateException

if called after the frame has been released.