SegmentDownloader.BaseFactory


protected abstract class SegmentDownloader.BaseFactoryFilterableManifest>

A base class of the factory of the concrete extension of SegmentDownloader.

Summary

Public constructors

BaseFactory(
    CacheDataSource.Factory cacheDataSourceFactory,
    ParsingLoadable.Parser manifestParser
)

Public methods

abstract SegmentDownloader<Object>
create(MediaItem mediaItem)

Creates the segment downloader.

SegmentDownloader.BaseFactory

Sets the duration in microseconds from the startPositionUs to be downloaded, or TIME_UNSET if the media should be downloaded to the end.

SegmentDownloader.BaseFactory

Sets the Executor used to make requests for the media being downloaded.

SegmentDownloader.BaseFactory
@CanIgnoreReturnValue
setMaxMergedSegmentStartTimeDiffMs(
    long maxMergedSegmentStartTimeDiffMs
)

Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.

SegmentDownloader.BaseFactory

Sets the start position in microseconds that the download should start from.

Protected fields

cacheDataSourceFactory

protected final CacheDataSource.Factory cacheDataSourceFactory

durationUs

protected long durationUs

executor

protected Executor executor

manifestParser

protected ParsingLoadable.Parser manifestParser

maxMergedSegmentStartTimeDiffMs

protected long maxMergedSegmentStartTimeDiffMs

startPositionUs

protected long startPositionUs

Public constructors

BaseFactory

public BaseFactory(
    CacheDataSource.Factory cacheDataSourceFactory,
    ParsingLoadable.Parser manifestParser
)

Public methods

create

public abstract SegmentDownloader<Objectcreate(MediaItem mediaItem)

Creates the segment downloader.

Parameters
MediaItem mediaItem

The MediaItem to be downloaded.

setDurationUs

@CanIgnoreReturnValue
public SegmentDownloader.BaseFactory setDurationUs(long durationUs)

Sets the duration in microseconds from the startPositionUs to be downloaded, or TIME_UNSET if the media should be downloaded to the end.

setExecutor

@CanIgnoreReturnValue
public SegmentDownloader.BaseFactory setExecutor(Executor executor)

Sets the Executor used to make requests for the media being downloaded. Providing an Executor that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.

setMaxMergedSegmentStartTimeDiffMs

@CanIgnoreReturnValue
public SegmentDownloader.BaseFactory setMaxMergedSegmentStartTimeDiffMs(
    long maxMergedSegmentStartTimeDiffMs
)

Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.

setStartPositionUs

@CanIgnoreReturnValue
public SegmentDownloader.BaseFactory setStartPositionUs(long startPositionUs)

Sets the start position in microseconds that the download should start from.