# GlTextureProducer.Listener

# GlTextureProducer.Listener

Artifact:[androidx.media3:media3-effect](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/effect/GlTextureProducer.java+class:androidx.media3.effect.GlTextureProducer.Listener)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/effect/GlTextureProducer.Listener "View this page in Java")

<br />

```
interface GlTextureProducer.Listener
```

<br />

*** ** * ** ***

Listener for texture output.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [flush](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer.Listener#flush())`()` Flushes the texture output listener.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTextureRendered](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer.Listener#onTextureRendered(androidx.media3.effect.GlTextureProducer,androidx.media3.common.GlTextureInfo,long,long))`(` ` textureProducer: `[GlTextureProducer](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer)`!,` ` outputTexture: `[GlTextureInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/GlTextureInfo)`!,` ` presentationTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` syncObject: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Called when a texture has been rendered to. |

## Public functions

### flush

```
fun flush(): Unit
```

Flushes the texture output listener.  

|                                                                           Throws                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [androidx.media3.common.VideoFrameProcessingException](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException) |   |

### onTextureRendered

```
fun onTextureRendered(
    textureProducer: GlTextureProducer!,
    outputTexture: GlTextureInfo!,
    presentationTimeUs: Long,
    syncObject: Long
): Unit
```

Called when a texture has been rendered to.  

|                                                             Parameters                                                             |
|------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `textureProducer: `[GlTextureProducer](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer)`!` | The[GlTextureProducer](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureProducer)that has rendered the texture.                                                                                                              |
| `outputTexture: `[GlTextureInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/GlTextureInfo)`!`           | The texture that has been rendered.                                                                                                                                                                                                                        |
| `presentationTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                | The presentation time of the texture.                                                                                                                                                                                                                      |
| `syncObject: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                        | A GL sync object that has been inserted into the GL command stream after the last write of the`outputTexture`. Value is 0 if and only if the[glFenceSync](https://developer.android.com/reference/android/opengl/GLES30.html#glFenceSync(int, int))failed. |

|                                                                           Throws                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [androidx.media3.common.VideoFrameProcessingException](https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException) |   |
| [androidx.media3.common.util.GlUtil.GlException](https://developer.android.com/reference/kotlin/androidx/media3/common/util/GlUtil.GlException)             |   |