Loader.Loadable


interface Loader.Loadable

Known direct subclasses
Chunk

An abstract base class for Loadable implementations that load chunks of data required for the playback of streams.

ParsingLoadable

A Loadable for objects that can be parsed from binary data using a Parser.

Known indirect subclasses
BaseMediaChunk

A base implementation of MediaChunk that outputs to a BaseMediaChunkOutput.

ContainerMediaChunk

A BaseMediaChunk that uses an Extractor to decode sample data.

DataChunk

A base class for Chunk implementations where the data should be loaded into a byte[] before being consumed.

FakeMediaChunk

Fake MediaChunk.

InitializationChunk

A Chunk that uses an Extractor to decode initialization data for single track.

MediaChunk

An abstract base class for Chunks that contain media samples.

SingleSampleMediaChunk

This class is deprecated.

The only use for this class is subtitle playback, but it is only compatible with legacy subtitle decoding, which is not supported by default.


An object that can be loaded using a Loader.

Summary

Public functions

Unit

Cancels the load.

Unit

Performs the load, returning on completion or cancellation.

Public functions

cancelLoad

fun cancelLoad(): Unit

Cancels the load.

Loadable implementations should ensure that a currently executing load call will exit reasonably quickly after this method is called. The load call may exit either by returning or by throwing an IOException.

If there is a currently executing load call, then the thread on which that call is being made will be interrupted immediately after the call to this method. Hence implementations do not need to (and should not attempt to) interrupt the loading thread themselves.

Although the loading thread will be interrupted, Loadable implementations should not use the interrupted status of the loading thread in load to determine whether the load has been canceled. This approach is not robust [Internal ref: b/79223737]. Instead, implementations should use their own flag to signal cancelation (for example, using ).

load

fun load(): Unit

Performs the load, returning on completion or cancellation.

Throws
java.io.IOException

If the input could not be loaded.