Back to Exoplayer

MediaParserHlsMediaChunkExtractor (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/hls/MediaParserHlsMediaChunkExtractor.html

latest11.1 KB
Original Source

Package com.google.android.exoplayer2.source.hls

Class MediaParserHlsMediaChunkExtractor

  • java.lang.Object

    • com.google.android.exoplayer2.source.hls.MediaParserHlsMediaChunkExtractor
  • All Implemented Interfaces:HlsMediaChunkExtractor


@RequiresApi(30)[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classMediaParserHlsMediaChunkExtractorextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[HlsMediaChunkExtractor](HlsMediaChunkExtractor.html "interface in com.google.android.exoplayer2.source.hls")

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.

HlsMediaChunkExtractor implemented on top of the platform's MediaParser.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static HlsExtractorFactory | FACTORY | Deprecated.

HlsExtractorFactory implementation that produces MediaParserHlsMediaChunkExtractor for all container formats except WebVTT, for which a BundledHlsMediaChunkExtractor is 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 | | --- | --- | --- | | void | init​(ExtractorOutput extractorOutput) | Deprecated.

Initializes the extractor with an ExtractorOutput. | | boolean | isPackedAudioExtractor() | Deprecated.

Returns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4. | | boolean | isReusable() | Deprecated.

Returns whether this instance can be used for extracting multiple continuous segments. | | void | onTruncatedSegmentParsed() | Deprecated.

Resets the sample parsing state. | | boolean | read​(ExtractorInput extractorInput) | Deprecated.

Extracts data read from a provided ExtractorInput. | | HlsMediaChunkExtractor | recreate() | Deprecated.

Returns a new instance for extracting the same type of media as this one. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

FACTORY

public static final[HlsExtractorFactory](HlsExtractorFactory.html "interface in com.google.android.exoplayer2.source.hls")FACTORY

Deprecated.

HlsExtractorFactory implementation that produces MediaParserHlsMediaChunkExtractor for all container formats except WebVTT, for which a BundledHlsMediaChunkExtractor is returned.

Constructor Detail

- 

MediaParserHlsMediaChunkExtractor

public MediaParserHlsMediaChunkExtractor​([MediaParser](https://developer.android.com/reference/android/media/MediaParser.html "class or interface in android.media")mediaParser,[OutputConsumerAdapterV30](../mediaparser/OutputConsumerAdapterV30.html "class in com.google.android.exoplayer2.source.mediaparser")outputConsumerAdapter,[Format](../../Format.html "class in com.google.android.exoplayer2")format,
                                         boolean overrideInBandCaptionDeclarations,[ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html "class or interface in android.media")> muxedCaptionMediaFormats,
                                         int leadingBytesToSkip,[PlayerId](../../analytics/PlayerId.html "class in com.google.android.exoplayer2.analytics")playerId)

Deprecated.

Creates a new instance. Parameters:mediaParser - The MediaParser instance to use for extraction of segments. The provided instance must have completed sniffing, or must have been created by name.outputConsumerAdapter - The OutputConsumerAdapterV30 with which mediaParser was created.format - The Format associated with the segment.overrideInBandCaptionDeclarations - Whether to ignore any in-band caption track declarations in favor of using the muxedCaptionMediaFormats instead. If false, caption declarations found in the extracted media will be used, causing muxedCaptionMediaFormats to be ignored instead.muxedCaptionMediaFormats - The list of in-band caption MediaFormats that MediaParser should expose.leadingBytesToSkip - The number of bytes to skip from the start of the input before starting extraction.playerId - The PlayerId of the player using this chunk extractor.

Method Detail

- 

init

public void init​([ExtractorOutput](../../extractor/ExtractorOutput.html "interface in com.google.android.exoplayer2.extractor")extractorOutput)

Deprecated.

Description copied from interface: HlsMediaChunkExtractor

Initializes the extractor with an ExtractorOutput. Called at most once. Specified by:init in interface HlsMediaChunkExtractorParameters:extractorOutput - An ExtractorOutput to receive extracted data.

- 

read

public boolean read​([ExtractorInput](../../extractor/ExtractorInput.html "interface in com.google.android.exoplayer2.extractor")extractorInput)
             throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Deprecated.

Description copied from interface: HlsMediaChunkExtractor

Extracts data read from a provided ExtractorInput. Must not be called before HlsMediaChunkExtractor.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 an ExtractorInput with an unchanged read position to a subsequent call to this method.

Specified by:read in interface HlsMediaChunkExtractorParameters: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: HlsMediaChunkExtractor

Returns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4. Specified by:isPackedAudioExtractor in interface HlsMediaChunkExtractor

- 

isReusable

public boolean isReusable()

Deprecated.

Description copied from interface: HlsMediaChunkExtractor

Returns whether this instance can be used for extracting multiple continuous segments. Specified by:isReusable in interface HlsMediaChunkExtractor

- 

recreate

public[HlsMediaChunkExtractor](HlsMediaChunkExtractor.html "interface in com.google.android.exoplayer2.source.hls")recreate()

Deprecated.

Description copied from interface: HlsMediaChunkExtractor

Returns a new instance for extracting the same type of media as this one. Can only be called on instances that are not reusable. Specified by:recreate in interface HlsMediaChunkExtractor

- 

onTruncatedSegmentParsed

public void onTruncatedSegmentParsed()

Deprecated.

Description copied from interface: HlsMediaChunkExtractor

Resets 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:onTruncatedSegmentParsed in interface HlsMediaChunkExtractor