SegmentDownloader.BaseFactory


protected abstract class SegmentDownloader.BaseFactory<M extends FilterableManifest<M>>


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

Summary

Public constructors

BaseFactory(
    CacheDataSource.Factory cacheDataSourceFactory,
    ParsingLoadable.Parser<M> manifestParser
)

Public methods

abstract SegmentDownloader<Object>
create(MediaItem mediaItem)

Creates the segment downloader.

SegmentDownloader.BaseFactory<M>

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<M>

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

SegmentDownloader.BaseFactory<M>
@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<M>

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<M> manifestParser

maxMergedSegmentStartTimeDiffMs

protected long maxMergedSegmentStartTimeDiffMs

startPositionUs

protected long startPositionUs

Public constructors

BaseFactory

public BaseFactory(
    CacheDataSource.Factory cacheDataSourceFactory,
    ParsingLoadable.Parser<M> 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<M> 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<M> 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<M> 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<M> setStartPositionUs(long startPositionUs)

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