DefaultAssetLoaderFactory


@UnstableApi
public final class DefaultAssetLoaderFactory implements AssetLoader.Factory


The default AssetLoader.Factory implementation.

Summary

Public constructors

Creates an instance with the default Clock and Codec.DecoderFactory.

DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock
)

Creates an instance.

DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    MediaSource.Factory mediaSourceFactory,
    BitmapLoader bitmapLoader
)

Creates an instance.

Public methods

AssetLoader
createAssetLoader(
    EditedMediaItem editedMediaItem,
    Looper looper,
    AssetLoader.Listener listener,
    AssetLoader.CompositionSettings compositionSettings
)

Creates an AssetLoader instance.

Public constructors

DefaultAssetLoaderFactory

public DefaultAssetLoaderFactory(Context context, BitmapLoader bitmapLoader)

Creates an instance with the default Clock and Codec.DecoderFactory.

For multi-picture formats (e.g. gifs), a single image frame from the container is loaded. The frame loaded is determined by the BitmapLoader implementation.

Parameters
Context context

The Context.

BitmapLoader bitmapLoader

The BitmapLoader to use to load and decode images.

DefaultAssetLoaderFactory

public DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock
)

Creates an instance.

Uses DataSourceBitmapLoader to load images, setting the inPreferredColorSpace to SRGB when possible.

Parameters
Context context

The Context.

Codec.DecoderFactory decoderFactory

The Codec.DecoderFactory to use to decode the samples (if necessary).

Clock clock

The Clock to use. It should always be DEFAULT, except for testing.

DefaultAssetLoaderFactory

public DefaultAssetLoaderFactory(
    Context context,
    Codec.DecoderFactory decoderFactory,
    Clock clock,
    MediaSource.Factory mediaSourceFactory,
    BitmapLoader bitmapLoader
)

Creates an instance.

Parameters
Context context

The Context.

Codec.DecoderFactory decoderFactory

The Codec.DecoderFactory to use to decode the samples (if necessary).

Clock clock

The Clock to use. It should always be DEFAULT, except for testing.

MediaSource.Factory mediaSourceFactory

The MediaSource.Factory to use to retrieve the samples to transform when an ExoPlayerAssetLoader is used.

BitmapLoader bitmapLoader

The BitmapLoader to use to load and decode images.

Public methods

createAssetLoader

public AssetLoader createAssetLoader(
    EditedMediaItem editedMediaItem,
    Looper looper,
    AssetLoader.Listener listener,
    AssetLoader.CompositionSettings compositionSettings
)

Creates an AssetLoader instance.

Parameters
EditedMediaItem editedMediaItem

The EditedMediaItem to load.

Looper looper

The Looper that's used to access the AssetLoader after it's been created.

AssetLoader.Listener listener

The Listener on which the AssetLoader should notify of events.

AssetLoader.CompositionSettings compositionSettings

The CompositionSettings.

Returns
AssetLoader

An AssetLoader.