GlTextureFrame
@ExperimentalApi
public class GlTextureFrame
A frame that wraps a GlTextureInfo.
Summary
Nested types |
|---|
public final class GlTextureFrame.BuilderA builder for |
Constants |
|
|---|---|
static final GlTextureFrame |
Public fields |
|
|---|---|
final long |
The OpenGL fence sync object (a |
final Format |
The format of the frame. |
final GlTextureInfo |
The |
final ImmutableMap<String, Object> |
|
final long |
The presentation time of the frame, in microseconds. |
final Consumer<GlTextureInfo> |
The |
final Executor |
The |
final long |
The release time of the frame, in nanoseconds. |
Public methods |
|
|---|---|
GlTextureFrame.Builder |
Returns a |
ImmutableMap<String, Object> |
|
void |
release(@Nullable SyncFenceWrapper releaseFence)Releases the frame and its underlying resources. |
void |
retain()Increases the reference count of this frame. |
Constants
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.
presentationTimeUs
public final long presentationTimeUs
The presentation time of the frame, in microseconds.
releaseTextureCallback
public final Consumer<GlTextureInfo> releaseTextureCallback
The Consumer to call to release the texture.
releaseTextureExecutor
public final Executor releaseTextureExecutor
The Executor on which the releaseTextureCallback is called.
Public methods
buildUpon
public GlTextureFrame.Builder buildUpon()
Returns a Builder initialized with the values of this instance.
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 |
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. |