Back to Exoplayer

HlsMediaChunkExtractor (ExoPlayer library)

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

latest5.0 KB
Original Source

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

Interface HlsMediaChunkExtractor

  • All Known Implementing Classes:BundledHlsMediaChunkExtractor, MediaParserHlsMediaChunkExtractor

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceHlsMediaChunkExtractor

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.

Extracts samples and track Formats from HlsMediaChunks.

Method Summary

All Methods Instance Methods Abstract 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. |

Method Detail

- 

init

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

Deprecated.

Initializes the extractor with an ExtractorOutput. Called at most once. Parameters:extractorOutput - An ExtractorOutput to receive extracted data.

- 

read

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.

Extracts data read from a provided ExtractorInput. Must not be called before 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.

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

boolean isPackedAudioExtractor()

Deprecated.

Returns whether this is a packed audio extractor, as defined in RFC 8216, Section 3.4.

- 

isReusable

boolean isReusable()

Deprecated.

Returns whether this instance can be used for extracting multiple continuous segments.

- 

recreate

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

Deprecated.

Returns a new instance for extracting the same type of media as this one. Can only be called on instances that are not reusable.

- 

onTruncatedSegmentParsed

void onTruncatedSegmentParsed()

Deprecated.

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.