ImageAssetLoader


@UnstableApi
public final class ImageAssetLoader implements AssetLoader


An AssetLoader implementation that loads images into Bitmap instances.

Supports the image formats listed here except from GIFs, which could exhibit unexpected behavior.

Summary

Nested types

public final class ImageAssetLoader.Factory implements AssetLoader.Factory

An AssetLoader.Factory for ImageAssetLoader instances.

Constants

static final String

Public methods

ImmutableMap<IntegerString>

Return the used decoders' names.

int

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

void

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

void

Starts the asset loader.

Inherited Constants

From androidx.media3.transformer.AssetLoader
static final int

Indicates that the asset loader can output decoded samples.

static final int

Indicates that the asset loader can output encoded samples.

Constants

MIME_TYPE_IMAGE_ALL

public static final String MIME_TYPE_IMAGE_ALL = "image/*"

Public methods

getDecoderNames

public ImmutableMap<IntegerStringgetDecoderNames()

Return the used decoders' names.

Returns
ImmutableMap<IntegerString>

The decoders' names keyed by track type.

getProgress

@Transformer.ProgressState
public 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

public void release()

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

start

public void start()

Starts the asset loader.