@UnstableApi
public 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.

public interface AssetLoader.Factory

A factory for AssetLoader instances.

public interface AssetLoader.Listener

A listener of AssetLoader events.

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

Supported output types of an asset loader.

Constants

default static final int

Indicates that the asset loader can output decoded samples.

default static final int

Indicates that the asset loader can output encoded samples.

Public methods

abstract ImmutableMap<IntegerString>

Return the used decoders' names.

abstract int

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

abstract void

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

abstract void

Starts the asset loader.

Constants

SUPPORTED_OUTPUT_TYPE_DECODED

default static final int SUPPORTED_OUTPUT_TYPE_DECODED = 2

Indicates that the asset loader can output decoded samples.

SUPPORTED_OUTPUT_TYPE_ENCODED

default static final int SUPPORTED_OUTPUT_TYPE_ENCODED = 1

Indicates that the asset loader can output encoded samples.

Public methods

getDecoderNames

abstract ImmutableMap<IntegerStringgetDecoderNames()

Return the used decoders' names.

Returns
ImmutableMap<IntegerString>

The decoders' names keyed by track type.

getProgress

@Transformer.ProgressState
abstract int getProgress(ProgressHolder progressHolder)

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.

Returns
int

The Transformer.ProgressState.

release

abstract void release()

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

start

abstract void start()

Starts the asset loader.