# GlTextureFrameConsumer

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

*** ** * ** ***


```
@ExperimentalApi
interface GlTextureFrameConsumer : AutoCloseable
```

<br />

Known direct subclasses [GlTextureFrameConsumer.GlTextureFrameProcessor](https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer.GlTextureFrameProcessor)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer.GlTextureFrameProcessor` | Allowing outputting `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame` from the `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer`. |

*** ** * ** ***

Consumes a `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame`.

This interface aims at resembling `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor`.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer.GlTextureFrameProcessor : https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer` Allowing outputting `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame` from the `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer#close()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer#isOutputFormatSupported(androidx.media3.common.Format)(format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!)` Returns whether this consumer supports the provided `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer#queue(androidx.media3.effect.GlTextureFrame,java.util.concurrent.Executor,java.lang.Runnable)( frame: https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame!, listenerExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html!, wakeupListener: https://developer.android.com/reference/java/lang/Runnable.html! )` Attempts to queue a frame for processing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer#signalEndOfStream()()` Notifies the current stream has ended. |

## Public functions

### close

```
fun close(): Unit
```

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException` |   |

### isOutputFormatSupported

```
fun isOutputFormatSupported(format: Format!): Boolean
```

Returns whether this consumer supports the provided `https://developer.android.com/reference/kotlin/androidx/media3/common/Format`.

Returns `true` by default.

### queue

```
fun queue(
    frame: GlTextureFrame!,
    listenerExecutor: Executor!,
    wakeupListener: Runnable!
): Boolean
```

Attempts to queue a frame for processing.

If the consumer is at capacity, it returns `false` and the `wakeupListener` will be invoked on the `listenerExecutor` when capacity becomes available.

| Parameters |
|---|---|
| `frame: https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame!` | The input frame to process. |
| `listenerExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html!` | The `https://developer.android.com/reference/java/util/concurrent/Executor.html` to run the `wakeupListener`. Must not execute synchronously (e.g., must not be a direct executor) to avoid re-entrant calls to `queue()`. |
| `wakeupListener: https://developer.android.com/reference/java/lang/Runnable.html!` | The callback invoked when capacity is freed. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | true if queued successfully, false if at capacity. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoFrameProcessingException` |   |

### signalEndOfStream

```
fun signalEndOfStream(): Unit
```

Notifies the current stream has ended.