# DefaultGlFrameProcessor

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

*** ** * ** ***


```
@ExperimentalApi
class DefaultGlFrameProcessor : FrameProcessor
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor` implementation that executes a chain of `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrameConsumer`s.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) class https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor.Factory : https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Factory` A `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Factory` that creates `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor` instances. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor.Factory.Builder` A builder for `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor.Factory` instances. |

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#BT2020_HLG()` An HDR color space with BT.2020 color primaries, and HLG transfer function. |
| `const https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#BT2020_LINEAR()` An HDR color space with BT.2020 color primaries, and linear transfer function. |
| `const https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#BT709_LINEAR()` An SDR color space with BT.709 / sRGB color primaries, and linear transfer function. |
| `const https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#BT709_SRGB()` An SDR color space with BT.709 / sRGB color primaries, and sRGB transfer function. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#KEY_COMPOSITION_EFFECTS() = "KEY_COMPOSITION_EFFECTS"` Metadata key for storing the `https://developer.android.com/reference/java/util/List.html` of video `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect` to apply on the composited frames, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#KEY_COMPOSITION_SEQUENCE_INDEX() = "KEY_COMPOSITION_SEQUENCE_INDEX"` Metadata key for storing the integer index to identify the source sequence in a ` Composition` from which an input frame comes, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#KEY_COMPOSITOR_SETTINGS() = "KEY_COMPOSITOR_SETTINGS"` Metadata key for storing the `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoCompositorSettings`, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#KEY_FRAME_DISCONTINUITY_NUMBER() = "KEY_FRAME_DISCONTINUITY_NUMBER"` Metadata key for storing the frame discontinuity number, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()` and `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame#getMetadata()`. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#KEY_ITEM_EFFECTS() = "KEY_ITEM_EFFECTS"` Metadata key for storing the `https://developer.android.com/reference/java/util/List.html` of video `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect` to apply on a single media item, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#close()()` Blocks until all resources are released. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#queue(java.util.List<androidx.media3.common.video.AsyncFrame>)(frames: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame!>!)` Attempts to queue a `https://developer.android.com/reference/java/util/List.html` of `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame` for processing. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/effect/DefaultGlFrameProcessor#signalEndOfStream()()` Notifies this processor that the current stream has ended. |

### Inherited functions

From [java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable.html) `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/java/lang/AutoCloseable.html#close()()`

## Constants

### BT2020_HLG

```
const val BT2020_HLG: ColorInfo!
```

An HDR color space with BT.2020 color primaries, and HLG transfer function.

When input is PQ or Ultra HDR (JPEG_R), values are first converted to optical linear BT.2020 display light and normalized against the 1,000-nit HLG reference display peak. The resulting display light is converted to scene light via inverse HLG OOTF (system gamma 1.2) and encoded into an HLG electrical signal using the BT.2100 HLG OETF.

HLG signal cannot represent scene light above 1.0 (either from display light above the 1,000-nit reference peak or saturated primaries where inverse OOTF boosts channel values above 1.0), so scene light is scaled down to fit in `[0.0, 1.0]` after the inverse HLG OOTF and before the OETF; all channels are scaled equally to preserve chromaticity.

The values are always scene-referred.

### BT2020_LINEAR

```
const val BT2020_LINEAR: ColorInfo!
```

An HDR color space with BT.2020 color primaries, and linear transfer function.

Values are display-referred linear optical light anchored on the ITU-R BT.2408 203-nit diffuse white reference, so `1.0` represents diffuse white, the 1,000-nit HLG reference peak evaluates to `~4.9224`, and the 10,000-nit PQ peak evaluates to `~49.2242`.

When input is HLG, HLG scene-referred electrical values are converted to display light using the ITU-R BT.2100 HLG EOTF (`OOTF_1.2(OETF^-1(E))`) and scaled onto the diffuse white anchor. When input is PQ, PQ electrical values are linearized using the SMPTE ST 2084 EOTF and scaled onto the diffuse white anchor. When input is Ultra HDR (JPEG_R), the sRGB base image is linearized to optical BT.709 display light (`1.0` = 203-nit diffuse white), boosted by the gainmap up to the 1,000-nit reference peak (`~4.9224`), and converted to BT.2020.

### BT709_LINEAR

```
const val BT709_LINEAR: ColorInfo!
```

An SDR color space with BT.709 / sRGB color primaries, and linear transfer function.

### BT709_SRGB

```
const val BT709_SRGB: ColorInfo!
```

An SDR color space with BT.709 / sRGB color primaries, and sRGB transfer function.

### KEY_COMPOSITION_EFFECTS

```
const val KEY_COMPOSITION_EFFECTS = "KEY_COMPOSITION_EFFECTS": String!
```

Metadata key for storing the `https://developer.android.com/reference/java/util/List.html` of video `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect` to apply on the composited frames, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`.

The order of effect application is `KEY_ITEM_EFFECTS`, `KEY_COMPOSITOR_SETTINGS` and then `KEY_COMPOSITION_EFFECTS`.

### KEY_COMPOSITION_SEQUENCE_INDEX

```
const val KEY_COMPOSITION_SEQUENCE_INDEX = "KEY_COMPOSITION_SEQUENCE_INDEX": String!
```

Metadata key for storing the integer index to identify the source sequence in a `
Composition` from which an input frame comes, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`.

### KEY_COMPOSITOR_SETTINGS

```
const val KEY_COMPOSITOR_SETTINGS = "KEY_COMPOSITOR_SETTINGS": String!
```

Metadata key for storing the `https://developer.android.com/reference/kotlin/androidx/media3/common/VideoCompositorSettings`, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`.

When using `CompositionPlayer` or `Transformer`, the value is `
Composition#videoCompositorSettings`.

The order of effect application is `KEY_ITEM_EFFECTS`, `KEY_COMPOSITOR_SETTINGS` and then `KEY_COMPOSITION_EFFECTS`.

### KEY_FRAME_DISCONTINUITY_NUMBER

```
const val KEY_FRAME_DISCONTINUITY_NUMBER = "KEY_FRAME_DISCONTINUITY_NUMBER": String!
```

Metadata key for storing the frame discontinuity number, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()` and `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlTextureFrame#getMetadata()`.

The number is an integer, incremented every time the player reports a discontinuity (for example, when seeking).

The number is only mandatory for previewing use cases. It is used to trigger flushes in `https://developer.android.com/reference/kotlin/androidx/media3/effect/GlShaderProgram` implementations during discontinuities.

### KEY_ITEM_EFFECTS

```
const val KEY_ITEM_EFFECTS = "KEY_ITEM_EFFECTS": String!
```

Metadata key for storing the `https://developer.android.com/reference/java/util/List.html` of video `https://developer.android.com/reference/kotlin/androidx/media3/common/Effect` to apply on a single media item, in `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame#getMetadata()`.

The order of effect application is `KEY_ITEM_EFFECTS`, `KEY_COMPOSITOR_SETTINGS` and then `KEY_COMPOSITION_EFFECTS`.

## Public functions

### close

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

Blocks until all resources are released.

### queue

```
fun queue(frames: (Mutable)List<AsyncFrame!>!): Boolean
```

Attempts to queue a `https://developer.android.com/reference/java/util/List.html` of `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame` for processing.

All frames provided in a single invocation of this method represent the exact same point in time.

If this consumer is at capacity, this method returns `false` and the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Listener#onWakeup()` will be invoked when capacity becomes available.

If this method returns `true`, `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor.Listener#onFrameProcessed(androidx.media3.common.video.Frame,androidx.media3.common.video.SyncFenceWrapper)` must be called once with every input `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#frame()` instance queued, once the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/FrameProcessor` has finished processing the `frames`.

| Parameters |
|---|---|
| `frames: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame!>!` | The frames to queue. |

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

### signalEndOfStream

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

Notifies this processor that the current stream has ended.

More frames may be queued after calling this method, if the current stream changes.