Class MediaParserHlsMediaChunkExtractor
- java.lang.Object
-
- com.google.android.exoplayer2.source.hls.MediaParserHlsMediaChunkExtractor
-
- All Implemented Interfaces:
HlsMediaChunkExtractor
@RequiresApi(30) @Deprecated public final class MediaParserHlsMediaChunkExtractor extends Object implements HlsMediaChunkExtractor
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.HlsMediaChunkExtractorimplemented on top of the platform'sMediaParser.
-
-
Field Summary
Fields Modifier and Type Field Description static HlsExtractorFactoryFACTORYDeprecated.HlsExtractorFactoryimplementation that producesMediaParserHlsMediaChunkExtractorfor all container formats except WebVTT, for which aBundledHlsMediaChunkExtractoris returned.
-
Constructor Summary
Constructors Constructor Description MediaParserHlsMediaChunkExtractor(MediaParser mediaParser, OutputConsumerAdapterV30 outputConsumerAdapter, Format format, boolean overrideInBandCaptionDeclarations, ImmutableList<MediaFormat> muxedCaptionMediaFormats, int leadingBytesToSkip, PlayerId playerId)Deprecated.Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidinit(ExtractorOutput extractorOutput)Deprecated.Initializes the extractor with anExtractorOutput.booleanisPackedAudioExtractor()Deprecated.Returns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4.booleanisReusable()Deprecated.Returns whether this instance can be used for extracting multiple continuous segments.voidonTruncatedSegmentParsed()Deprecated.Resets the sample parsing state.booleanread(ExtractorInput extractorInput)Deprecated.Extracts data read from a providedExtractorInput.HlsMediaChunkExtractorrecreate()Deprecated.Returns a new instance for extracting the same type of media as this one.
-
-
-
Field Detail
-
FACTORY
public static final HlsExtractorFactory FACTORY
Deprecated.HlsExtractorFactoryimplementation that producesMediaParserHlsMediaChunkExtractorfor all container formats except WebVTT, for which aBundledHlsMediaChunkExtractoris returned.
-
-
Constructor Detail
-
MediaParserHlsMediaChunkExtractor
public MediaParserHlsMediaChunkExtractor(MediaParser mediaParser, OutputConsumerAdapterV30 outputConsumerAdapter, Format format, boolean overrideInBandCaptionDeclarations, ImmutableList<MediaFormat> muxedCaptionMediaFormats, int leadingBytesToSkip, PlayerId playerId)
Deprecated.Creates a new instance.- Parameters:
mediaParser- TheMediaParserinstance to use for extraction of segments. The provided instance must have completed sniffing, or must have been created by name.outputConsumerAdapter- TheOutputConsumerAdapterV30with whichmediaParserwas created.format- TheFormatassociated with the segment.overrideInBandCaptionDeclarations- Whether to ignore any in-band caption track declarations in favor of using themuxedCaptionMediaFormatsinstead. If false, caption declarations found in the extracted media will be used, causingmuxedCaptionMediaFormatsto be ignored instead.muxedCaptionMediaFormats- The list of in-band captionMediaFormatsthatMediaParsershould expose.leadingBytesToSkip- The number of bytes to skip from the start of the input before starting extraction.playerId- ThePlayerIdof the player using this chunk extractor.
-
-
Method Detail
-
init
public void init(ExtractorOutput extractorOutput)
Deprecated.Description copied from interface:HlsMediaChunkExtractorInitializes the extractor with anExtractorOutput. Called at most once.- Specified by:
initin interfaceHlsMediaChunkExtractor- Parameters:
extractorOutput- AnExtractorOutputto receive extracted data.
-
read
public boolean read(ExtractorInput extractorInput) throws IOException
Deprecated.Description copied from interface:HlsMediaChunkExtractorExtracts data read from a providedExtractorInput. Must not be called beforeHlsMediaChunkExtractor.init(ExtractorOutput).A single call to this method will block until some progress has been made, but will not block for longer than this. Hence each call will consume only a small amount of input data.
When this method throws an
IOException, extraction may continue by providing anExtractorInputwith an unchangedread positionto a subsequent call to this method.- Specified by:
readin interfaceHlsMediaChunkExtractor- Parameters:
extractorInput- The input to read from.- Returns:
- Whether there is any data left to extract. Returns false if the end of input has been reached.
- Throws:
IOException- If an error occurred reading from or parsing the input.
-
isPackedAudioExtractor
public boolean isPackedAudioExtractor()
Deprecated.Description copied from interface:HlsMediaChunkExtractorReturns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4.- Specified by:
isPackedAudioExtractorin interfaceHlsMediaChunkExtractor
-
isReusable
public boolean isReusable()
Deprecated.Description copied from interface:HlsMediaChunkExtractorReturns whether this instance can be used for extracting multiple continuous segments.- Specified by:
isReusablein interfaceHlsMediaChunkExtractor
-
recreate
public HlsMediaChunkExtractor recreate()
Deprecated.Description copied from interface:HlsMediaChunkExtractorReturns a new instance for extracting the same type of media as this one. Can only be called on instances that are notreusable.- Specified by:
recreatein interfaceHlsMediaChunkExtractor
-
onTruncatedSegmentParsed
public void onTruncatedSegmentParsed()
Deprecated.Description copied from interface:HlsMediaChunkExtractorResets the sample parsing state.Resetting the parsing state allows support for Fragmented MP4 EXT-X-I-FRAME-STREAM-INF segments. EXT-X-I-FRAME-STREAM-INF segments are truncated to include only a leading key frame. After parsing said keyframe, an extractor may reach an unexpected end of file. By resetting its state, we can continue feeding samples from the following segments to the extractor. See #7512 for context.
- Specified by:
onTruncatedSegmentParsedin interfaceHlsMediaChunkExtractor
-
-