DefaultAssetLoaderFactory


@UnstableApi
class DefaultAssetLoaderFactory : AssetLoader.Factory


The default AssetLoader.Factory implementation.

Summary

Public constructors

DefaultAssetLoaderFactory(
    context: Context!,
    forceInterpretHdrAsSdr: Boolean,
    bitmapLoader: BitmapLoader!
)

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

DefaultAssetLoaderFactory(
    context: Context!,
    decoderFactory: Codec.DecoderFactory!,
    forceInterpretHdrAsSdr: Boolean,
    clock: Clock!
)

Creates an instance.

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

Creates an instance.

Public functions

AssetLoader!
createAssetLoader(
    editedMediaItem: EditedMediaItem!,
    looper: Looper!,
    listener: AssetLoader.Listener!
)

Creates an AssetLoader instance.

Public constructors

DefaultAssetLoaderFactory

DefaultAssetLoaderFactory(
    context: Context!,
    forceInterpretHdrAsSdr: Boolean,
    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.

forceInterpretHdrAsSdr: Boolean

Whether to apply HDR_MODE_EXPERIMENTAL_FORCE_INTERPRET_HDR_AS_SDR.

bitmapLoader: BitmapLoader!

The BitmapLoader to use to load and decode images.

DefaultAssetLoaderFactory

DefaultAssetLoaderFactory(
    context: Context!,
    decoderFactory: Codec.DecoderFactory!,
    forceInterpretHdrAsSdr: Boolean,
    clock: Clock!
)

Creates an instance.

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

Parameters
context: Context!

The Context.

decoderFactory: Codec.DecoderFactory!

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

forceInterpretHdrAsSdr: Boolean

Whether to apply HDR_MODE_EXPERIMENTAL_FORCE_INTERPRET_HDR_AS_SDR.

clock: Clock!

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

DefaultAssetLoaderFactory

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

Creates an instance.

Parameters
context: Context!

The Context.

decoderFactory: Codec.DecoderFactory!

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

forceInterpretHdrAsSdr: Boolean

Whether to apply HDR_MODE_EXPERIMENTAL_FORCE_INTERPRET_HDR_AS_SDR.

clock: Clock!

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

mediaSourceFactory: MediaSource.Factory!

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 functions

createAssetLoader

fun createAssetLoader(
    editedMediaItem: EditedMediaItem!,
    looper: Looper!,
    listener: AssetLoader.Listener!
): AssetLoader!

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.

listener: AssetLoader.Listener!

The Listener on which the AssetLoader should notify of events.

Returns
AssetLoader!

An AssetLoader.