public interface SsChunkSource.Factory


Factory for SsChunkSources.

Summary

Public methods

abstract SsChunkSource
createChunkSource(
    LoaderErrorThrower manifestLoaderErrorThrower,
    SsManifest manifest,
    int streamElementIndex,
    ExoTrackSelection trackSelection,
    @Nullable TransferListener transferListener,
    @Nullable CmcdConfiguration cmcdConfiguration
)

Creates a new SsChunkSource.

default SsChunkSource.Factory
@CanIgnoreReturnValue
experimentalParseSubtitlesDuringExtraction(
    boolean parseSubtitlesDuringExtraction
)

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue).

default Format

Returns the output Format of emitted text samples which were originally in sourceFormat.

default SsChunkSource.Factory

Sets the SubtitleParser.Factory to use for parsing subtitles during extraction.

Public methods

createChunkSource

abstract SsChunkSource createChunkSource(
    LoaderErrorThrower manifestLoaderErrorThrower,
    SsManifest manifest,
    int streamElementIndex,
    ExoTrackSelection trackSelection,
    @Nullable TransferListener transferListener,
    @Nullable CmcdConfiguration cmcdConfiguration
)

Creates a new SsChunkSource.

Parameters
LoaderErrorThrower manifestLoaderErrorThrower

Throws errors affecting loading of manifests.

SsManifest manifest

The initial manifest.

int streamElementIndex

The index of the corresponding stream element in the manifest.

ExoTrackSelection trackSelection

The track selection.

@Nullable TransferListener transferListener

The transfer listener which should be informed of any data transfers. May be null if no listener is available.

@Nullable CmcdConfiguration cmcdConfiguration

The CmcdConfiguration for this chunk source.

Returns
SsChunkSource

The created SsChunkSource.

experimentalParseSubtitlesDuringExtraction

@CanIgnoreReturnValue
default SsChunkSource.Factory experimentalParseSubtitlesDuringExtraction(
    boolean parseSubtitlesDuringExtraction
)

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue). Defaults to false (i.e. subtitles will be parsed as part of rendering).

This method is experimental and will be renamed or removed in a future release.

Parameters
boolean parseSubtitlesDuringExtraction

Whether to parse subtitles during extraction or rendering.

Returns
SsChunkSource.Factory

This factory, for convenience.

getOutputTextFormat

default Format getOutputTextFormat(Format sourceFormat)

Returns the output Format of emitted text samples which were originally in sourceFormat.

In many cases, where an Extractor emits samples from the source without mutation, this method simply returns sourceFormat. In other cases, such as an Extractor that transcodes subtitles from the sourceFormat to APPLICATION_MEDIA3_CUES, the format is updated to indicate the transcoding that is taking place.

Non-text source formats are always returned without mutation.

Parameters
Format sourceFormat

The original text-based format.

Returns
Format

The Format that will be associated with a text track.

setSubtitleParserFactory

@CanIgnoreReturnValue
default SsChunkSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)

Sets the SubtitleParser.Factory to use for parsing subtitles during extraction. The default factory value is implementation dependent.

Parameters
SubtitleParser.Factory subtitleParserFactory

The SubtitleParser.Factory for parsing subtitles during extraction.

Returns
SsChunkSource.Factory

This factory, for convenience.