# TextureAssetLoader

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

*** ** * ** ***


```
@UnstableApi
class TextureAssetLoader : AssetLoader
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Use `https://developer.android.com/reference/kotlin/androidx/media3/transformer/RawAssetLoader`.

An `https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader` implementation that loads videos from `https://developer.android.com/reference/android/opengl/GLES10.html#GL_TEXTURE_2D` instances.

Typically instantiated in a custom `https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader.Factory` saving a reference to the created `https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader`. Provide video frames as input by calling `https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#queueInputTexture(int,long)`, then `https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#signalEndOfVideoInput()` when finished. Those methods must be called from the same thread, which can be any thread.

## Summary

| ### Public constructors |
|---|
| `[TextureAssetLoader](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#TextureAssetLoader(androidx.media3.transformer.EditedMediaItem,androidx.media3.transformer.AssetLoader.Listener,androidx.media3.common.Format,androidx.media3.common.OnInputFrameProcessedListener))( editedMediaItem: https://developer.android.com/reference/kotlin/androidx/media3/transformer/EditedMediaItem!, assetLoaderListener: https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader.Listener!, format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, frameProcessedListener: https://developer.android.com/reference/kotlin/androidx/media3/common/OnInputFrameProcessedListener! )` **This function is deprecated.** Deprecated in Java |

| ### Public functions |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `[getDecoderNames](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#getDecoderNames())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/transformer/Transformer.ProgressState [getProgress](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#getProgress(androidx.media3.transformer.ProgressHolder))(progressHolder: https://developer.android.com/reference/kotlin/androidx/media3/transformer/ProgressHolder!)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `[queueInputTexture](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#queueInputTexture(int,long))(texId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[release](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#release())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[signalEndOfVideoInput](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#signalEndOfVideoInput())()` **This function is deprecated.** Deprecated in Java |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[start](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#start())()` **This function is deprecated.** Deprecated in Java |

### Inherited Constants

From [androidx.media3.transformer.AssetLoader](https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader) `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader#SUPPORTED_OUTPUT_TYPE_DECODED() = 2`

**This property is deprecated.** Deprecated in Java
`const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader#SUPPORTED_OUTPUT_TYPE_ENCODED() = 1`

**This property is deprecated.** Deprecated in Java

## Public constructors

### TextureAssetLoader

```
[TextureAssetLoader](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#TextureAssetLoader(androidx.media3.transformer.EditedMediaItem,androidx.media3.transformer.AssetLoader.Listener,androidx.media3.common.Format,androidx.media3.common.OnInputFrameProcessedListener))(
    editedMediaItem: EditedMediaItem!,
    assetLoaderListener: AssetLoader.Listener!,
    format: Format!,
    frameProcessedListener: OnInputFrameProcessedListener!
)
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Creates an instance.

The `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EditedMediaItem#durationUs()`, `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#width()` and `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#height()` must be set.

| Parameters |
|---|---|
| `editedMediaItem: https://developer.android.com/reference/kotlin/androidx/media3/transformer/EditedMediaItem!` | Information about the media item for which frames are provided. |
| `assetLoaderListener: https://developer.android.com/reference/kotlin/androidx/media3/transformer/AssetLoader.Listener!` | Listener for asset loading events. |
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | Information about the format of video frames. |
| `frameProcessedListener: https://developer.android.com/reference/kotlin/androidx/media3/common/OnInputFrameProcessedListener!` | Listener for the event when a frame has been processed. The listener receives a GL sync object (if supported) to allow reusing the texture after it's no longer in use. |

## Public functions

### getDecoderNames

```
fun [getDecoderNames](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#getDecoderNames())(): ImmutableMap<Int!, String!>!
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Return the used decoders' names.

| Returns |
|---|---|
| `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableMap.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | The decoders' names keyed by `https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType`. |

### getProgress

```
@Transformer.ProgressState
fun [getProgress](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#getProgress(androidx.media3.transformer.ProgressHolder))(progressHolder: ProgressHolder!): Int
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Returns the current `https://developer.android.com/reference/kotlin/androidx/media3/transformer/Transformer.ProgressState` and updates `progressHolder` with the current progress if it is `https://developer.android.com/reference/kotlin/androidx/media3/transformer/Transformer#PROGRESS_STATE_AVAILABLE()`.

| Parameters |
|---|---|
| `progressHolder: https://developer.android.com/reference/kotlin/androidx/media3/transformer/ProgressHolder!` | A `https://developer.android.com/reference/kotlin/androidx/media3/transformer/ProgressHolder`, updated to hold the percentage progress if `https://developer.android.com/reference/kotlin/androidx/media3/transformer/Transformer#PROGRESS_STATE_AVAILABLE()`. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/transformer/Transformer.ProgressState`. |

### queueInputTexture

```
fun [queueInputTexture](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#queueInputTexture(int,long))(texId: Int, presentationTimeUs: Long): Boolean
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Attempts to provide an input texture.

Must be called on the same thread as `https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#signalEndOfVideoInput()`.

| Parameters |
|---|---|
| `texId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The ID of the texture to queue. |
| `presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The presentation time for the texture, in microseconds. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the texture was successfully queued. If `false`, the caller should try again later. |

### release

```
fun [release](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#release())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Stops loading data and releases all resources associated with the asset loader.

### signalEndOfVideoInput

```
fun [signalEndOfVideoInput](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#signalEndOfVideoInput())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Signals that no further input frames will be rendered.

Must be called on the same thread as `https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#queueInputTexture(int,long)`.

### start

```
fun [start](https://developer.android.com/reference/kotlin/androidx/media3/transformer/TextureAssetLoader#start())(): Unit
```

> [!CAUTION]
> **This function is deprecated.**   
> Deprecated in Java

Starts the asset loader.