Class MediaParserChunkExtractor

  • All Implemented Interfaces:

    public final class MediaParserChunkExtractor
    extends Object
    implements ChunkExtractor
    Deprecated. 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.
    • Constructor Detail

      • MediaParserChunkExtractor

        public MediaParserChunkExtractor​( int primaryTrackType,
                                         Format manifestFormat,
                                         List<Format> closedCaptionFormats,
                                         PlayerId playerId)
        Creates a new instance.
        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 trackOutputProvider,
                         long startTimeUs,
                         long endTimeUs)
        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 ChunkExtractor
        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()
        Description copied from interface: ChunkExtractor
        Releases any held resources.
        Specified by:
        release in interface ChunkExtractor
      • read

        public boolean read​(ExtractorInput input)
                     throws IOException
        Description copied from interface: ChunkExtractor
        Reads from the given ExtractorInput.
        Specified by:
        read in interface ChunkExtractor
        input - The input to read from.
        Whether there is any data left to extract. Returns false if the end of input has been reached.
        IOException - If an error occurred reading from or parsing the input.
      • getSampleFormats

        public Format[] getSampleFormats()
        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