5package io.flutter.embedding.engine.renderer;
7import android.graphics.SurfaceTexture;
8import androidx.annotation.Keep;
9import androidx.annotation.NonNull;
10import androidx.annotation.Nullable;
21 private SurfaceTexture surfaceTexture;
22 private boolean released;
23 private boolean attached;
24 private Runnable onFrameConsumed;
25 private boolean newFrameAvailable =
false;
28 this(surfaceTexture,
null);
40 @NonNull SurfaceTexture surfaceTexture, @Nullable Runnable onFrameConsumed) {
41 this.surfaceTexture = surfaceTexture;
42 this.released =
false;
43 this.onFrameConsumed = onFrameConsumed;
48 return surfaceTexture;
53 newFrameAvailable =
true;
59 return newFrameAvailable;
64 @SuppressWarnings(
"unused")
67 newFrameAvailable =
false;
69 surfaceTexture.updateTexImage();
70 if (onFrameConsumed !=
null) {
71 onFrameConsumed.run();
80 surfaceTexture.release();
88 @SuppressWarnings(
"unused")
102 surfaceTexture.detachFromGLContext();
104 surfaceTexture.attachToGLContext(texName);
110 @SuppressWarnings(
"unused")
112 synchronized (
this) {
113 if (attached && !released) {
114 surfaceTexture.detachFromGLContext();
121 @SuppressWarnings(
"unused")
123 surfaceTexture.getTransformMatrix(mtx);
SurfaceTextureWrapper( @NonNull SurfaceTexture surfaceTexture, @Nullable Runnable onFrameConsumed)
SurfaceTextureWrapper(@NonNull SurfaceTexture surfaceTexture)
void attachToGLContext(int texName)
SurfaceTexture surfaceTexture()
void getTransformMatrix(@NonNull float[] mtx)
void detachFromGLContext()