EGLSurfaceTexture


@UnstableApi
class EGLSurfaceTexture : SurfaceTexture.OnFrameAvailableListener, Runnable


Generates a SurfaceTexture using EGL/GLES functions.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
annotation EGLSurfaceTexture.SecureMode

Secure mode to be used by the EGL surface and context.

Listener to be called when the texture image on SurfaceTexture has been updated.

Constants

const Int

No secure EGL surface and context required.

const Int

Creating a secure surface backed by a pixel buffer.

const Int

Creating a surfaceless, secured EGL context.

Public constructors

EGLSurfaceTexture(
    handler: Handler!,
    callback: EGLSurfaceTexture.TextureImageListener?
)

Public functions

SurfaceTexture!

Returns the wrapped SurfaceTexture.

Unit

Initializes required EGL parameters and creates the SurfaceTexture.

Unit
onFrameAvailable(surfaceTexture: SurfaceTexture!)
Unit

Releases all allocated resources.

Unit
run()

Constants

SECURE_MODE_NONE

const val SECURE_MODE_NONE = 0: Int

No secure EGL surface and context required.

SECURE_MODE_PROTECTED_PBUFFER

const val SECURE_MODE_PROTECTED_PBUFFER = 2: Int

Creating a secure surface backed by a pixel buffer.

SECURE_MODE_SURFACELESS_CONTEXT

const val SECURE_MODE_SURFACELESS_CONTEXT = 1: Int

Creating a surfaceless, secured EGL context.

Public constructors

EGLSurfaceTexture

EGLSurfaceTexture(handler: Handler!)
Parameters
handler: Handler!

The Handler that will be used to call updateTexImage to update images on the SurfaceTexture. Note that init has to be called on the same looper thread as the Handler's looper.

EGLSurfaceTexture

EGLSurfaceTexture(
    handler: Handler!,
    callback: EGLSurfaceTexture.TextureImageListener?
)
Parameters
handler: Handler!

The Handler that will be used to call updateTexImage to update images on the SurfaceTexture. Note that init has to be called on the same looper thread as the looper of the .

callback: EGLSurfaceTexture.TextureImageListener?

The TextureImageListener to be called when the texture image on has been updated. This callback will be called on the same handler thread as the handler.

Public functions

getSurfaceTexture

fun getSurfaceTexture(): SurfaceTexture!

Returns the wrapped SurfaceTexture. This can only be called after init.

init

fun init(@EGLSurfaceTexture.SecureMode secureMode: Int): Unit

Initializes required EGL parameters and creates the SurfaceTexture.

Parameters
@EGLSurfaceTexture.SecureMode secureMode: Int

The SecureMode to be used for EGL surface.

onFrameAvailable

fun onFrameAvailable(surfaceTexture: SurfaceTexture!): Unit

release

fun release(): Unit

Releases all allocated resources.

run

fun run(): Unit