DashMediaSource.Factory
public final class DashMediaSource.Factory implements MediaSourceFactory
Factory for DashMediaSource
s.
Summary
Public constructors |
---|
Factory(DataSource.Factory dataSourceFactory) Creates a new factory for |
Factory( Creates a new factory for |
Public methods |
|
---|---|
DashMediaSource |
createMediaSource(DashManifest manifest) Returns a new |
DashMediaSource |
createMediaSource(MediaItem mediaItem) Returns a new |
DashMediaSource |
createMediaSource(DashManifest manifest, MediaItem mediaItem) Returns a new |
DashMediaSource.Factory |
@CanIgnoreReturnValue This method is deprecated. This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release. |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. |
int[] |
Returns the |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the factory to create composite |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the target |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets an optional |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the manifest parser to parse loaded manifest data when loading a manifest URI. |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the minimum position to start playback from in a live stream, in microseconds relative to the start of the live window. |
DashMediaSource.Factory |
@CanIgnoreReturnValue Sets the |
Inherited Constants |
||
---|---|---|
|
||
|
Public constructors
Factory
public Factory(DataSource.Factory dataSourceFactory)
Creates a new factory for DashMediaSource
s.
The factory will use the following default components:
DefaultDashChunkSource.Factory
DefaultDrmSessionManagerProvider
DefaultLoadErrorHandlingPolicy
DefaultCompositeSequenceableLoaderFactory
Parameters | |
---|---|
DataSource.Factory dataSourceFactory |
A factory for |
Factory
public Factory(
DashChunkSource.Factory chunkSourceFactory,
@Nullable DataSource.Factory manifestDataSourceFactory
)
Creates a new factory for DashMediaSource
s.
The factory will use the following default components:
DefaultDrmSessionManagerProvider
DefaultLoadErrorHandlingPolicy
DefaultCompositeSequenceableLoaderFactory
Parameters | |
---|---|
DashChunkSource.Factory chunkSourceFactory |
A factory for |
@Nullable DataSource.Factory manifestDataSourceFactory |
A factory for |
Public methods
createMediaSource
public DashMediaSource createMediaSource(DashManifest manifest)
Returns a new DashMediaSource
using the current parameters and the specified sideloaded manifest.
Parameters | |
---|---|
DashManifest manifest |
The manifest. |
Returns | |
---|---|
DashMediaSource |
The new |
Throws | |
---|---|
java.lang.IllegalArgumentException |
If |
createMediaSource
public DashMediaSource createMediaSource(MediaItem mediaItem)
Returns a new DashMediaSource
using the current parameters.
Parameters | |
---|---|
MediaItem mediaItem |
The media item of the dash stream. |
Returns | |
---|---|
DashMediaSource |
The new |
Throws | |
---|---|
java.lang.NullPointerException |
if |
createMediaSource
public DashMediaSource createMediaSource(DashManifest manifest, MediaItem mediaItem)
Returns a new DashMediaSource
using the current parameters and the specified sideloaded manifest.
Parameters | |
---|---|
DashManifest manifest |
The manifest. |
MediaItem mediaItem |
The |
Returns | |
---|---|
DashMediaSource |
The new |
Throws | |
---|---|
java.lang.IllegalArgumentException |
If |
experimentalParseSubtitlesDuringExtraction
@CanIgnoreReturnValue
public DashMediaSource.FactoryexperimentalParseSubtitlesDuringExtraction(
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 true
(i.e. subtitles will be parsed during extraction).
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 | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
experimentalSetCodecsToParseWithinGopSampleDependencies
@CanIgnoreReturnValue
public DashMediaSource.Factory experimentalSetCodecsToParseWithinGopSampleDependencies(
@C.VideoCodecFlags int codecsToParseWithinGopSampleDependencies
)
Sets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. Defaults to 0
- empty set of codecs.
Having access to additional sample dependency information can speed up seeking. See FLAG_READ_WITHIN_GOP_SAMPLE_DEPENDENCIES
.
This method is experimental and will be renamed or removed in a future release.
Parameters | |
---|---|
@C.VideoCodecFlags int codecsToParseWithinGopSampleDependencies |
The set of codecs for which to parse within GOP sample dependency information. |
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
getSupportedTypes
@C.ContentType
public int[] getSupportedTypes()
Returns the content types
supported by media sources created by this factory.
setCmcdConfigurationFactory
@CanIgnoreReturnValue
public DashMediaSource.Factory setCmcdConfigurationFactory(
CmcdConfiguration.Factory cmcdConfigurationFactory
)
Sets the CmcdConfiguration.Factory
used to obtain a CmcdConfiguration
for a MediaItem
.
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setCompositeSequenceableLoaderFactory
@CanIgnoreReturnValue
public DashMediaSource.Factory setCompositeSequenceableLoaderFactory(
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory
)
Sets the factory to create composite SequenceableLoader
s for when this media source loads data from multiple streams (video, audio etc...). The default is an instance of .
Parameters | |
---|---|
CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory |
A factory to create composite s for when this media source loads data from multiple streams (video, audio etc...). |
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setDrmSessionManagerProvider
@CanIgnoreReturnValue
public DashMediaSource.Factory setDrmSessionManagerProvider(
DrmSessionManagerProvider drmSessionManagerProvider
)
Sets the DrmSessionManagerProvider
used to obtain a DrmSessionManager
for a MediaItem
.
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setFallbackTargetLiveOffsetMs
@CanIgnoreReturnValue
public DashMediaSource.Factory setFallbackTargetLiveOffsetMs(long fallbackTargetLiveOffsetMs)
Sets the target offset for live streams
that is used if no value is defined in the MediaItem
or the manifest.
The default value is DEFAULT_FALLBACK_TARGET_LIVE_OFFSET_MS
.
Parameters | |
---|---|
long fallbackTargetLiveOffsetMs |
The fallback live target offset in milliseconds. |
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setLoadErrorHandlingPolicy
@CanIgnoreReturnValue
public DashMediaSource.Factory setLoadErrorHandlingPolicy(
LoadErrorHandlingPolicy loadErrorHandlingPolicy
)
Sets an optional LoadErrorHandlingPolicy
.
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setManifestParser
@CanIgnoreReturnValue
public DashMediaSource.Factory setManifestParser(
@Nullable ParsingLoadable.Parser<DashManifest> manifestParser
)
Sets the manifest parser to parse loaded manifest data when loading a manifest URI.
Parameters | |
---|---|
@Nullable ParsingLoadable.Parser<DashManifest> manifestParser |
A parser for loaded manifest data. |
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setMinLiveStartPositionUs
@CanIgnoreReturnValue
public DashMediaSource.Factory setMinLiveStartPositionUs(long minLiveStartPositionUs)
Sets the minimum position to start playback from in a live stream, in microseconds relative to the start of the live window.
This value will override any suggested value from the manifest and helps to prevent issues.
The default value is MIN_LIVE_DEFAULT_START_POSITION_US
.
Parameters | |
---|---|
long minLiveStartPositionUs |
The minimum live start position, in microseconds relative to the start of the live window. |
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |
setSubtitleParserFactory
@CanIgnoreReturnValue
public DashMediaSource.Factory setSubtitleParserFactory(SubtitleParser.Factory subtitleParserFactory)
Sets the SubtitleParser.Factory
to be used for parsing subtitles during extraction.
Parameters | |
---|---|
SubtitleParser.Factory subtitleParserFactory |
The |
Returns | |
---|---|
DashMediaSource.Factory |
This factory, for convenience. |