-
- All Implemented Interfaces:
-
android.graphics.SurfaceTexture.OnFrameAvailableListener,java.lang.Runnable
@RequiresApi(value = 17) public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableListener, Runnable
Generates a SurfaceTexture using EGL/GLES functions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceEGLSurfaceTexture.TextureImageListenerListener to be called when the texture image on SurfaceTexture has been updated.
public @interfaceEGLSurfaceTexture.SecureModeSecure mode to be used by the EGL surface and context. One of SECURE_MODE_NONE, or SECURE_MODE_PROTECTED_PBUFFER.
-
Field Summary
Fields Modifier and Type Field Description public final static intSECURE_MODE_NONEpublic final static intSECURE_MODE_SURFACELESS_CONTEXTpublic final static intSECURE_MODE_PROTECTED_PBUFFER
-
Constructor Summary
Constructors Constructor Description EGLSurfaceTexture(Handler handler)EGLSurfaceTexture(Handler handler, EGLSurfaceTexture.TextureImageListener callback)
-
Method Summary
Modifier and Type Method Description voidinit(@EGLSurfaceTexture.SecureMode() int secureMode)Initializes required EGL parameters and creates the SurfaceTexture. voidrelease()Releases all allocated resources. SurfaceTexturegetSurfaceTexture()Returns the wrapped SurfaceTexture. voidonFrameAvailable(SurfaceTexture surfaceTexture)voidrun()-
-
Constructor Detail
-
EGLSurfaceTexture
EGLSurfaceTexture(Handler handler)
- Parameters:
handler- The Handler that will be used to call to update images on the SurfaceTexture.
-
EGLSurfaceTexture
EGLSurfaceTexture(Handler handler, EGLSurfaceTexture.TextureImageListener callback)
- Parameters:
handler- The Handler that will be used to call to update images on the SurfaceTexture.callback- The TextureImageListener to be called when the texture image on has been updated.
-
-
Method Detail
-
init
void init(@EGLSurfaceTexture.SecureMode() int secureMode)
Initializes required EGL parameters and creates the SurfaceTexture.
- Parameters:
secureMode- The SecureMode to be used for EGL surface.
-
release
void release()
Releases all allocated resources.
-
getSurfaceTexture
SurfaceTexture getSurfaceTexture()
Returns the wrapped SurfaceTexture. This can only be called after init.
-
onFrameAvailable
void onFrameAvailable(SurfaceTexture surfaceTexture)
-
run
void run()
-
-
-
-