SurfaceTextureListener

interface SurfaceTextureListener
android.view.TextureView.SurfaceTextureListener

This listener can be used to be notified when the surface texture associated with this texture view is available.
Requires API level 14 (Android 4.0, IceCreamSandwich)

Summary

Public methods
abstract Unit
onSurfaceTextureSizeChanged(surface: SurfaceTexture!, width: Int, height: Int)

Invoked when the SurfaceTexture's buffers size changed.

abstract Unit

Invoked when the specified SurfaceTexture is updated through SurfaceTexture#updateTexImage().

abstract Boolean

Invoked when the specified SurfaceTexture is about to be destroyed.

abstract Unit
onSurfaceTextureAvailable(surface: SurfaceTexture!, width: Int, height: Int)

Invoked when a TextureView's SurfaceTexture is ready for use.

Public methods

onSurfaceTextureSizeChanged

added in API level 14
abstract fun onSurfaceTextureSizeChanged(surface: SurfaceTexture!, width: Int, height: Int): Unit

Invoked when the SurfaceTexture's buffers size changed.
Requires API level 14 (Android 4.0, IceCreamSandwich)

Parameters
surface SurfaceTexture!: The surface returned by android.view.TextureView#getSurfaceTexture()
width SurfaceTexture!: The new width of the surface
height SurfaceTexture!: The new height of the surface

onSurfaceTextureUpdated

added in API level 14
abstract fun onSurfaceTextureUpdated(surface: SurfaceTexture!): Unit

Invoked when the specified SurfaceTexture is updated through SurfaceTexture#updateTexImage().
Requires API level 14 (Android 4.0, IceCreamSandwich)

Parameters
surface SurfaceTexture!: The surface just updated

onSurfaceTextureDestroyed

added in API level 14
abstract fun onSurfaceTextureDestroyed(surface: SurfaceTexture!): Boolean

Invoked when the specified SurfaceTexture is about to be destroyed. If returns true, no rendering should happen inside the surface texture after this method is invoked. If returns false, the client needs to call SurfaceTexture#release(). Most applications should return true.
Requires API level 14 (Android 4.0, IceCreamSandwich)

Parameters
surface SurfaceTexture!: The surface about to be destroyed

onSurfaceTextureAvailable

added in API level 14
abstract fun onSurfaceTextureAvailable(surface: SurfaceTexture!, width: Int, height: Int): Unit

Invoked when a TextureView's SurfaceTexture is ready for use.
Requires API level 14 (Android 4.0, IceCreamSandwich)

Parameters
surface SurfaceTexture!: The surface returned by android.view.TextureView#getSurfaceTexture()
width SurfaceTexture!: The width of the surface
height SurfaceTexture!: The height of the surface