Back to Exoplayer

MediaParserChunkExtractor (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/chunk/MediaParserChunkExtractor.html

latest8.6 KB
Original Source

Package com.google.android.exoplayer2.source.chunk

Class MediaParserChunkExtractor

  • java.lang.Object

    • com.google.android.exoplayer2.source.chunk.MediaParserChunkExtractor
  • All Implemented Interfaces:ChunkExtractor


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

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.

ChunkExtractor implemented on top of the platform's MediaParser.

Nested Class Summary

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.source.chunk.ChunkExtractor

ChunkExtractor.Factory, ChunkExtractor.TrackOutputProvider

Field Summary

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

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | MediaParserChunkExtractor​(@com.google.android.exoplayer2.C.TrackType int primaryTrackType, Format manifestFormat, List<Format> closedCaptionFormats, PlayerId playerId) | Deprecated.

Creates a new instance. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | ChunkIndex | getChunkIndex() | Deprecated.

Returns the ChunkIndex most recently obtained from the chunks, or null if a ChunkIndex has not been obtained. | | Format[] | getSampleFormats() | Deprecated.

Returns the sample Formats for the tracks identified by the extractor, or null if the extractor has not finished identifying tracks. | | void | init​(ChunkExtractor.TrackOutputProvider trackOutputProvider, long startTimeUs, long endTimeUs) | Deprecated.

Initializes the wrapper to output to TrackOutputs provided by the specified ChunkExtractor.TrackOutputProvider, and configures the extractor to receive data from a new chunk. | | boolean | read​(ExtractorInput input) | Deprecated.

Reads from the given ExtractorInput. | | void | release() | Deprecated.

Releases any held resources. |

- 

Methods inherited from class java.lang.Object

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

Field Detail

- 

FACTORY

public static final[ChunkExtractor.Factory](ChunkExtractor.Factory.html "interface in com.google.android.exoplayer2.source.chunk")FACTORY

Deprecated.

Constructor Detail

- 

MediaParserChunkExtractor

public MediaParserChunkExtractor​(@com.google.android.exoplayer2.C.TrackType int primaryTrackType,[Format](../../Format.html "class in com.google.android.exoplayer2")manifestFormat,[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[Format](../../Format.html "class in com.google.android.exoplayer2")> closedCaptionFormats,[PlayerId](../../analytics/PlayerId.html "class in com.google.android.exoplayer2.analytics")playerId)

Deprecated.

Creates a new instance. Parameters:primaryTrackType - The type of the primary track. C.TRACK_TYPE_NONE if there is no primary track.manifestFormat - The chunks Format as obtained from the manifest.closedCaptionFormats - A list containing the Formats of the closed-caption tracks in the chunks.playerId - The PlayerId of the player this chunk extractor is used for.

Method Detail

- 

init

public void init​(@Nullable[ChunkExtractor.TrackOutputProvider](ChunkExtractor.TrackOutputProvider.html "interface in com.google.android.exoplayer2.source.chunk")trackOutputProvider,
                 long startTimeUs,
                 long endTimeUs)

Deprecated.

Description copied from interface: ChunkExtractor

Initializes the wrapper to output to TrackOutputs provided by the specified ChunkExtractor.TrackOutputProvider, and configures the extractor to receive data from a new chunk. Specified by:init in interface ChunkExtractorParameters:trackOutputProvider - The provider of TrackOutputs that will receive sample data.startTimeUs - The start position in the new chunk, or C.TIME_UNSET to output samples from the start of the chunk.endTimeUs - The end position in the new chunk, or C.TIME_UNSET to output samples to the end of the chunk.

- 

release

public void release()

Deprecated.

Description copied from interface: ChunkExtractor

Releases any held resources. Specified by:release in interface ChunkExtractor

- 

read

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

Deprecated.

Description copied from interface: ChunkExtractor

Reads from the given ExtractorInput. Specified by:read in interface ChunkExtractorParameters:input - 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.

- 

getChunkIndex

@Nullable
public[ChunkIndex](../../extractor/ChunkIndex.html "class in com.google.android.exoplayer2.extractor")getChunkIndex()

Deprecated.

Description copied from interface: ChunkExtractor

Returns the ChunkIndex most recently obtained from the chunks, or null if a ChunkIndex has not been obtained. Specified by:getChunkIndex in interface ChunkExtractor

- 

getSampleFormats

@Nullable
public[Format](../../Format.html "class in com.google.android.exoplayer2")[] getSampleFormats()

Deprecated.

Description copied from interface: ChunkExtractor

Returns the sample Formats for the tracks identified by the extractor, or null if the extractor has not finished identifying tracks. Specified by:getSampleFormats in interface ChunkExtractor