DefaultHlsExtractorFactory
@UnstableApi
public final class DefaultHlsExtractorFactory implements HlsExtractorFactory
Default HlsExtractorFactory implementation.
Summary
Public constructors |
|---|
|
Equivalent to |
DefaultHlsExtractorFactory(Creates a factory for HLS segment extractors. |
Public methods |
|
|---|---|
BundledHlsMediaChunkExtractor |
createExtractor(Creates an |
DefaultHlsExtractorFactory |
@CanIgnoreReturnValueSets 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). |
DefaultHlsExtractorFactory |
@CanIgnoreReturnValueSets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. |
Format |
getOutputTextFormat(Format sourceFormat)Returns the output of emitted C#TRACK_TYPE_TEXT text samples which were originally in sourceFormat}. |
DefaultHlsExtractorFactory |
@CanIgnoreReturnValueSets the |
Inherited Constants |
||
|---|---|---|
|
Public constructors
DefaultHlsExtractorFactory
public DefaultHlsExtractorFactory()
Equivalent to new DefaultHlsExtractorFactory(payloadReaderFactoryFlags = 0, exposeCea608WhenMissingDeclarations = true)
DefaultHlsExtractorFactory
public DefaultHlsExtractorFactory(
int payloadReaderFactoryFlags,
boolean exposeCea608WhenMissingDeclarations
)
Creates a factory for HLS segment extractors.
| Parameters | |
|---|---|
int payloadReaderFactoryFlags |
Flags to add when constructing any |
boolean exposeCea608WhenMissingDeclarations |
Whether created |
Public methods
createExtractor
public BundledHlsMediaChunkExtractor createExtractor(
Uri uri,
Format format,
@Nullable List<Format> muxedCaptionFormats,
TimestampAdjuster timestampAdjuster,
Map<String, List<String>> responseHeaders,
ExtractorInput sniffingExtractorInput,
PlayerId playerId
)
Creates an Extractor for extracting HLS media chunks.
| Parameters | |
|---|---|
Uri uri |
The URI of the media chunk. |
Format format |
A |
@Nullable List<Format> muxedCaptionFormats |
List of muxed caption |
TimestampAdjuster timestampAdjuster |
Adjuster corresponding to the provided discontinuity sequence number. |
Map<String, List<String>> responseHeaders |
The HTTP response headers associated with the media segment or initialization section to extract. |
ExtractorInput sniffingExtractorInput |
The first extractor input that will be passed to the returned extractor's |
PlayerId playerId |
The |
| Returns | |
|---|---|
BundledHlsMediaChunkExtractor |
| Throws | |
|---|---|
java.io.IOException |
If an I/O error is encountered while sniffing. |
experimentalParseSubtitlesDuringExtraction
@CanIgnoreReturnValue
public DefaultHlsExtractorFactory 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 | |
|---|---|
DefaultHlsExtractorFactory |
This factory, for convenience. |
experimentalSetCodecsToParseWithinGopSampleDependencies
@CanIgnoreReturnValue
public DefaultHlsExtractorFactory 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 | |
|---|---|
DefaultHlsExtractorFactory |
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 performs transcoding of the original format to APPLICATION_MEDIA3_CUES if it is supported by SubtitleParser.Factory.
To modify the support behavior, you can set your own subtitle parser factory.
setSubtitleParserFactory
@CanIgnoreReturnValue
public DefaultHlsExtractorFactory 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 |
| Returns | |
|---|---|
DefaultHlsExtractorFactory |
This factory, for convenience. |