@UnstableApi
interface AssetLoader

Known direct subclasses
ExoPlayerAssetLoader

An AssetLoader implementation that uses an ExoPlayer to load samples.

ImageAssetLoader

An AssetLoader implementation that loads images into Bitmap instances.

RawAssetLoader

An AssetLoader implementation that loads raw audio and/or video data.

SurfaceAssetLoader

Asset loader that outputs video data passed to its input Surface.

TextureAssetLoader

This class is deprecated.

Use RawAssetLoader.


Provides media data to a Transformer.

The output samples can be encoded or decoded.

Only audio and video samples are supported. Both audio and video tracks can be provided by a single asset loader, but outputting multiple tracks of the same type is not supported.

An asset loader is responsible for removing audio or video if requested.

If slow motion flattening is requested, the asset loader should flatten the video track for media containing slow motion markers. This is usually done prior to decoding. The audio samples are flattened after they are output by the AssetLoader, because this is done on decoded samples.

Summary

Nested types

Customizations set on the composition-level that are needed when loading each of the individual assets in the Composition.

A factory for AssetLoader instances.

A listener of AssetLoader events.

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(flag = true, value = )
annotation AssetLoader.SupportedOutputTypes

Supported output types of an asset loader.

Constants

const Int

Indicates that the asset loader can output decoded samples.

const Int

Indicates that the asset loader can output encoded samples.

Public functions

ImmutableMap<Int!, String!>!

Return the used decoders' names.

Int

Returns the current Transformer.ProgressState and updates progressHolder with the current progress if it is available.

Unit

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

Unit

Starts the asset loader.

Constants

SUPPORTED_OUTPUT_TYPE_DECODED

const val SUPPORTED_OUTPUT_TYPE_DECODED = 2: Int

Indicates that the asset loader can output decoded samples.

SUPPORTED_OUTPUT_TYPE_ENCODED

const val SUPPORTED_OUTPUT_TYPE_ENCODED = 1: Int

Indicates that the asset loader can output encoded samples.

Public functions

getDecoderNames

fun getDecoderNames(): ImmutableMap<Int!, String!>!

Return the used decoders' names.

Returns
ImmutableMap<Int!, String!>!

The decoders' names keyed by track type.

getProgress

@Transformer.ProgressState
fun getProgress(progressHolder: ProgressHolder!): Int

Returns the current Transformer.ProgressState and updates progressHolder with the current progress if it is available.

Parameters
progressHolder: ProgressHolder!

A ProgressHolder, updated to hold the percentage progress if available.

release

fun release(): Unit

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

start

fun start(): Unit

Starts the asset loader.