DefaultDashChunkSource.Factory


public final class DefaultDashChunkSource.Factory implements DashChunkSource.Factory


DashChunkSource.Factory for DefaultDashChunkSource instances.

Summary

Public constructors

Factory(DataSource.Factory dataSourceFactory)

Equivalent to new Factory(BundledChunkExtractor.FACTORY, dataSourceFactory, maxSegmentsPerLoad = 1).

Factory(DataSource.Factory dataSourceFactory, int maxSegmentsPerLoad)

Equivalent to new Factory(BundledChunkExtractor.FACTORY, dataSourceFactory, maxSegmentsPerLoad).

Factory(
    ChunkExtractor.Factory chunkExtractorFactory,
    DataSource.Factory dataSourceFactory,
    int maxSegmentsPerLoad
)

Creates a new instance.

Public methods

DashChunkSource
createDashChunkSource(
    LoaderErrorThrower manifestLoaderErrorThrower,
    DashManifest manifest,
    BaseUrlExclusionList baseUrlExclusionList,
    int periodIndex,
    int[] adaptationSetIndices,
    ExoTrackSelection trackSelection,
    @C.TrackType int trackType,
    long elapsedRealtimeOffsetMs,
    boolean enableEventMessageTrack,
    List<Format> closedCaptionFormats,
    @Nullable PlayerEmsgHandler.PlayerTrackEmsgHandler playerEmsgHandler,
    @Nullable TransferListener transferListener,
    PlayerId playerId,
    @Nullable CmcdConfiguration cmcdConfiguration
)
DefaultDashChunkSource.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).

Format

Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}.

DefaultDashChunkSource.Factory

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

Public constructors

Factory

public Factory(DataSource.Factory dataSourceFactory, int maxSegmentsPerLoad)

Equivalent to new Factory(BundledChunkExtractor.FACTORY, dataSourceFactory, maxSegmentsPerLoad).

Factory

public Factory(
    ChunkExtractor.Factory chunkExtractorFactory,
    DataSource.Factory dataSourceFactory,
    int maxSegmentsPerLoad
)

Creates a new instance.

Parameters
ChunkExtractor.Factory chunkExtractorFactory

Creates ChunkExtractor instances to use for extracting chunks.

DataSource.Factory dataSourceFactory

Creates the DataSource to use for downloading chunks.

int maxSegmentsPerLoad

See DefaultDashChunkSource.

Public methods

createDashChunkSource

public DashChunkSource createDashChunkSource(
    LoaderErrorThrower manifestLoaderErrorThrower,
    DashManifest manifest,
    BaseUrlExclusionList baseUrlExclusionList,
    int periodIndex,
    int[] adaptationSetIndices,
    ExoTrackSelection trackSelection,
    @C.TrackType int trackType,
    long elapsedRealtimeOffsetMs,
    boolean enableEventMessageTrack,
    List<Format> closedCaptionFormats,
    @Nullable PlayerEmsgHandler.PlayerTrackEmsgHandler playerEmsgHandler,
    @Nullable TransferListener transferListener,
    PlayerId playerId,
    @Nullable CmcdConfiguration cmcdConfiguration
)
Parameters
LoaderErrorThrower manifestLoaderErrorThrower

Throws errors affecting loading of manifests.

DashManifest manifest

The initial manifest.

BaseUrlExclusionList baseUrlExclusionList

The base URL exclusion list.

int periodIndex

The index of the corresponding period in the manifest.

int[] adaptationSetIndices

The indices of the corresponding adaptation sets in the period.

ExoTrackSelection trackSelection

The track selection.

@C.TrackType int trackType

The track type.

long elapsedRealtimeOffsetMs

If known, an estimate of the instantaneous difference between server-side unix time and elapsedRealtime in milliseconds, specified as the server's unix time minus the local elapsed time. Or TIME_UNSET if unknown.

boolean enableEventMessageTrack

Whether to output an event message track.

List<Format> closedCaptionFormats

The Formats of closed caption tracks to be output.

@Nullable PlayerEmsgHandler.PlayerTrackEmsgHandler playerEmsgHandler

The track output to write emsg messages to, or null if emsgs shouldn't be written.

@Nullable TransferListener transferListener

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

PlayerId playerId

The PlayerId of the player using this chunk source.

@Nullable CmcdConfiguration cmcdConfiguration

The CmcdConfiguration for this chunk source.

Returns
DashChunkSource

The created DashChunkSource.

experimentalParseSubtitlesDuringExtraction

@CanIgnoreReturnValue
public DefaultDashChunkSource.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
DefaultDashChunkSource.Factory

This factory, for convenience.

getOutputTextFormat

public Format getOutputTextFormat(Format sourceFormat)

Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}.

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

Non-text source formats are always returned without mutation.

This implementation delegates determining of the output format to the passed to the constructor of this class.

setSubtitleParserFactory

@CanIgnoreReturnValue
public DefaultDashChunkSource.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
DefaultDashChunkSource.Factory

This factory, for convenience.