# GlShaderProgram.OutputListener

# GlShaderProgram.OutputListener

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/GlShaderProgram.java+class:androidx.media3.effect.GlShaderProgram.OutputListener)

*** ** * ** ***

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

<br />

```
interface GlShaderProgram.OutputListener
```

<br />

*** ** * ** ***

Listener for output-related video frame processing events.

This listener can be called from any thread.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onCurrentOutputStreamEnded](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram.OutputListener#onCurrentOutputStreamEnded())`()` Called when the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)will not produce further output frames belonging to the current output stream.                                                                                                                                                                                                                    |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onOutputFrameAvailable](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram.OutputListener#onOutputFrameAvailable(androidx.media3.common.GlTextureInfo,long))`(` ` 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) `)` Called when the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)has produced an output frame. |

## Public functions

### onCurrentOutputStreamEnded

```
fun onCurrentOutputStreamEnded(): Unit
```

Called when the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)will not produce further output frames belonging to the current output stream. May be called multiple times for one output stream.  

### onOutputFrameAvailable

```
fun onOutputFrameAvailable(
    outputTexture: GlTextureInfo!,
    presentationTimeUs: Long
): Unit
```

Called when the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)has produced an output frame.

After the listener's owner has processed the output frame, it must call[releaseOutputFrame](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram#releaseOutputFrame(androidx.media3.common.GlTextureInfo)). The output frame should be released as soon as possible, as there is no guarantee that the[GlShaderProgram](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram)will produce further output frames before this output frame is released.  

|                                                        Parameters                                                        |
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `outputTexture: `[GlTextureInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/GlTextureInfo)`!` | A[GlTextureInfo](https://developer.android.com/reference/kotlin/androidx/media3/common/GlTextureInfo)describing the texture containing the output frame. |
| `presentationTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                      | The presentation timestamp of the output frame, in microseconds.                                                                                         |