# 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
public interface GlTextureFrameConsumer extends AutoCloseable
```

<br />

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

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

*** ** * ** ***

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

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

## Summary

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

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

## Public methods

### close

```
abstract void close()
```

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

### isOutputFormatSupported

```
default boolean isOutputFormatSupported(Format format)
```

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

Returns `true` by default.

### queue

```
abstract boolean queue(
    GlTextureFrame frame,
    Executor listenerExecutor,
    Runnable wakeupListener
)
```

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 |
|---|---|
| `https://developer.android.com/reference/androidx/media3/effect/GlTextureFrame frame` | The input frame to process. |
| `https://developer.android.com/reference/java/util/concurrent/Executor.html listenerExecutor` | 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()`. |
| `https://developer.android.com/reference/java/lang/Runnable.html wakeupListener` | The callback invoked when capacity is freed. |

| Returns |
|---|---|
| `boolean` | true if queued successfully, false if at capacity. |

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

### signalEndOfStream

```
abstract void signalEndOfStream()
```

Notifies the current stream has ended.