大家使用
SurfaceTexture.OnFrameAvailableListener mOnFrameAvailableListener = (surfaceTexture -> {
}
对应---
/**
* Construct a new SurfaceTexture to stream images to a given OpenGL texture.
* <p>
* In single buffered mode the application is responsible for serializing access to the image
* content buffer. Each time the image content is to be updated, the
* {@link #releaseTexImage()} method must be called before the image content producer takes
* ownership of the buffer. For example, when producing image content with the NDK
* ANativeWindow_lock and ANativeWindow_unlockAndPost functions, {@link #releaseTexImage()}
* must be called before each ANativeWindow_lock, or that call will fail. When producing
* image content with OpenGL ES, {@link #releaseTexImage()} must be called before the first
* OpenGL ES function call each frame.
* <p>
* Unlike {@link #SurfaceTexture(int, boolean)}, which takes an OpenGL texture object name,
* this constructor creates the SurfaceTexture in detached mode. A texture name must be passed
* in using {@link #attachToGLContext} before calling {@link #releaseTexImage()} and producing
* image content using OpenGL ES.
*
* @param singleBufferMode whether the SurfaceTexture will be in single buffered mode.
*
* @thro