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.
Summary
Public methods | |
---|---|
abstract Unit |
onSurfaceTextureAvailable(surface: SurfaceTexture, width: Int, height: Int) Invoked when a |
abstract Boolean |
onSurfaceTextureDestroyed(surface: SurfaceTexture) Invoked when the specified |
abstract Unit |
onSurfaceTextureSizeChanged(surface: SurfaceTexture, width: Int, height: Int) Invoked when the |
abstract Unit |
onSurfaceTextureUpdated(surface: SurfaceTexture) Invoked when the specified |
Public methods
onSurfaceTextureAvailable
abstract fun onSurfaceTextureAvailable(
surface: SurfaceTexture,
width: Int,
height: Int
): Unit
Invoked when a TextureView
's SurfaceTexture is ready for use.
Parameters | |
---|---|
surface |
SurfaceTexture: The surface returned by android.view.TextureView#getSurfaceTexture() This value cannot be null . |
width |
Int: The width of the surface |
height |
Int: The height of the surface |
onSurfaceTextureDestroyed
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.
Parameters | |
---|---|
surface |
SurfaceTexture: The surface about to be destroyed This value cannot be null . |
onSurfaceTextureSizeChanged
abstract fun onSurfaceTextureSizeChanged(
surface: SurfaceTexture,
width: Int,
height: Int
): Unit
Invoked when the SurfaceTexture
's buffers size changed.
Parameters | |
---|---|
surface |
SurfaceTexture: The surface returned by android.view.TextureView#getSurfaceTexture() This value cannot be null . |
width |
Int: The new width of the surface |
height |
Int: The new height of the surface |
onSurfaceTextureUpdated
abstract fun onSurfaceTextureUpdated(surface: SurfaceTexture): Unit
Invoked when the specified SurfaceTexture
is updated through SurfaceTexture#updateTexImage()
.
Parameters | |
---|---|
surface |
SurfaceTexture: The surface just updated This value cannot be null . |