DefaultExtractorsFactory
@UnstableApi
class DefaultExtractorsFactory : ExtractorsFactory
An ExtractorsFactory that provides an array of extractors for the following formats:
- MP4, including M4A (
Mp4Extractor) - fMP4 (
FragmentedMp4Extractor) - Matroska and WebM (
MatroskaExtractor) - Ogg Vorbis/FLAC (
OggExtractor - MP3 (
Mp3Extractor) - AAC (
AdtsExtractor) - MPEG TS (
TsExtractor) - MPEG PS (
PsExtractor) - FLV (
FlvExtractor) - WAV (
WavExtractor) - AC3 (
Ac3Extractor) - AC4 (
Ac4Extractor) - AMR (
AmrExtractor) - FLAC
- If available, the FLAC extension's
androidx.media3.decoder.flac.FlacExtractoris used. - Otherwise, the core
FlacExtractoris used. Note that Android devices do not generally include a FLAC decoder before API 27. This can be worked around by using the FLAC extension or the FFmpeg extension.
- If available, the FLAC extension's
- JPEG (
JpegExtractor) - PNG (
PngExtractor) - WEBP (
WebpExtractor) - BMP (
BmpExtractor) - HEIF (
HeifExtractor) - AVIF (
AvifExtractor) - MIDI, if available, the MIDI extension's
androidx.media3.decoder.midi.MidiExtractoris used.
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
synchronized Array<Extractor!>! |
Returns an array of new |
synchronized Array<Extractor!>! |
Returns an array of new |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueSets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. |
synchronized DefaultExtractorsFactory! |
This function is deprecated. This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release. |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueConvenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it, and if it should be enabled even if the content length (and hence the duration of the media) is unknown. |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueConvenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it. |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueSets a |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueThis function is deprecated. This method (and all support for 'legacy' subtitle decoding during rendering) will be removed in a future release. |
synchronized DefaultExtractorsFactory! |
Sets flags for |
synchronized DefaultExtractorsFactory! |
Sets the mode for |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueSets the number of bytes searched to find a timestamp for |
synchronized DefaultExtractorsFactory! |
@CanIgnoreReturnValueSets a list of subtitle formats to pass to the |
Inherited Constants |
||
|---|---|---|
|
Public constructors
Public functions
createExtractors
synchronized fun createExtractors(): Array<Extractor!>!
Returns an array of new Extractor instances.
createExtractors
synchronized fun createExtractors(
uri: Uri!,
responseHeaders: (Mutable)Map<String!, (Mutable)List<String!>!>!
): Array<Extractor!>!
Returns an array of new Extractor instances.
experimentalSetCodecsToParseWithinGopSampleDependencies
@CanIgnoreReturnValue
synchronized fun experimentalSetCodecsToParseWithinGopSampleDependencies(
@C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int
): DefaultExtractorsFactory!
Sets the set of video codecs for which within GOP sample dependency information should be parsed as part of extraction. Defaults to 0 - empty set of codecs.
Having access to additional sample dependency information can speed up seeking. See FLAG_READ_WITHIN_GOP_SAMPLE_DEPENDENCIES.
This method is experimental and will be renamed or removed in a future release.
| Parameters | |
|---|---|
@C.VideoCodecFlags codecsToParseWithinGopSampleDependencies: Int |
The set of codecs for which to parse within GOP sample dependency information. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
This factory, for convenience. |
experimentalSetTextTrackTranscodingEnabled
synchronized funexperimentalSetTextTrackTranscodingEnabled(
textTrackTranscodingEnabled: Boolean
): DefaultExtractorsFactory!
Enables transcoding of text track samples to APPLICATION_MEDIA3_CUES before the data is emitted to TrackOutput.
Transcoding is enabled by default.
This method is experimental and will be renamed or removed in a future release.
| Parameters | |
|---|---|
textTrackTranscodingEnabled: Boolean |
Whether to enable transcoding. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
setAdtsExtractorFlags
@CanIgnoreReturnValue
synchronized fun setAdtsExtractorFlags(@AdtsExtractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for AdtsExtractor instances created by the factory.
| Parameters | |
|---|---|
@AdtsExtractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
AdtsExtractor |
setAmrExtractorFlags
@CanIgnoreReturnValue
synchronized fun setAmrExtractorFlags(@AmrExtractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for AmrExtractor instances created by the factory.
| Parameters | |
|---|---|
@AmrExtractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
AmrExtractor |
setConstantBitrateSeekingAlwaysEnabled
@CanIgnoreReturnValue
synchronized fun setConstantBitrateSeekingAlwaysEnabled(
constantBitrateSeekingAlwaysEnabled: Boolean
): DefaultExtractorsFactory!
Convenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it, and if it should be enabled even if the content length (and hence the duration of the media) is unknown. If set to true, the flags required to enable this functionality will be OR'd with those passed to the setters when creating extractor instances. If set to false then the flags passed to the setters will be used without modification.
When seeking into content where the length is unknown, application code should ensure that requested seek positions are valid, or should be ready to handle playback failures reported through onPlayerError with errorCode set to ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE.
| Parameters | |
|---|---|
constantBitrateSeekingAlwaysEnabled: Boolean |
Whether approximate seeking using a constant bitrate assumption should be enabled for all extractors that support it, including when the content duration is unknown. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
setConstantBitrateSeekingEnabled
@CanIgnoreReturnValue
synchronized fun setConstantBitrateSeekingEnabled(
constantBitrateSeekingEnabled: Boolean
): DefaultExtractorsFactory!
Convenience method to set whether approximate seeking using constant bitrate assumptions should be enabled for all extractors that support it. If set to true, the flags required to enable this functionality will be OR'd with those passed to the setters when creating extractor instances. If set to false then the flags passed to the setters will be used without modification.
| Parameters | |
|---|---|
constantBitrateSeekingEnabled: Boolean |
Whether approximate seeking using a constant bitrate assumption should be enabled for all extractors that support it. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
setFlacExtractorFlags
@CanIgnoreReturnValue
synchronized fun setFlacExtractorFlags(@FlacExtractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for FlacExtractor instances created by the factory. The flags are also used by androidx.media3.decoder.flac.FlacExtractor instances if the FLAC extension is being used.
| Parameters | |
|---|---|
@FlacExtractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
FlacExtractor |
setFragmentedMp4ExtractorFlags
@CanIgnoreReturnValue
synchronized fun setFragmentedMp4ExtractorFlags(@FragmentedMp4Extractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for FragmentedMp4Extractor instances created by the factory.
| Parameters | |
|---|---|
@FragmentedMp4Extractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
FragmentedMp4Extractor |
setHeifExtractorFlags
@CanIgnoreReturnValue
synchronized fun setHeifExtractorFlags(@HeifExtractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for HeifExtractor instances created by the factory.
| Parameters | |
|---|---|
@HeifExtractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
HeifExtractor |
setJpegExtractorFlags
@CanIgnoreReturnValue
synchronized fun setJpegExtractorFlags(@JpegExtractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for JpegExtractor instances created by the factory.
| Parameters | |
|---|---|
@JpegExtractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
JpegExtractor |
setMatroskaExtractorFlags
@CanIgnoreReturnValue
synchronized fun setMatroskaExtractorFlags(@MatroskaExtractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for MatroskaExtractor instances created by the factory.
| Parameters | |
|---|---|
@MatroskaExtractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
MatroskaExtractor |
setMp3ExtractorFlags
@CanIgnoreReturnValue
synchronized fun setMp3ExtractorFlags(@Mp3Extractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for Mp3Extractor instances created by the factory.
| Parameters | |
|---|---|
@Mp3Extractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
Mp3Extractor |
setMp4ExtractorFlags
@CanIgnoreReturnValue
synchronized fun setMp4ExtractorFlags(@Mp4Extractor.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for Mp4Extractor instances created by the factory.
| Parameters | |
|---|---|
@Mp4Extractor.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
Mp4Extractor |
setSubtitleParserFactory
@CanIgnoreReturnValue
synchronized fun setSubtitleParserFactory(subtitleParserFactory: SubtitleParser.Factory!): DefaultExtractorsFactory!
Sets a SubtitleParser.Factory to use when transcoding text tracks.
This is only works if experimentalSetTextTrackTranscodingEnabled is enabled.
| Parameters | |
|---|---|
subtitleParserFactory: SubtitleParser.Factory! |
The factory for |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
setTextTrackTranscodingEnabled
@CanIgnoreReturnValue
synchronized funsetTextTrackTranscodingEnabled(textTrackTranscodingEnabled: Boolean): DefaultExtractorsFactory!
setTsExtractorFlags
@CanIgnoreReturnValue
synchronized fun setTsExtractorFlags(@DefaultTsPayloadReaderFactory.Flags flags: Int): DefaultExtractorsFactory!
Sets flags for DefaultTsPayloadReaderFactorys used by TsExtractor instances created by the factory.
| Parameters | |
|---|---|
@DefaultTsPayloadReaderFactory.Flags flags: Int |
The flags to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
TsExtractor |
setTsExtractorMode
@CanIgnoreReturnValue
synchronized fun setTsExtractorMode(@TsExtractor.Mode mode: Int): DefaultExtractorsFactory!
Sets the mode for TsExtractor instances created by the factory.
| Parameters | |
|---|---|
@TsExtractor.Mode mode: Int |
The mode to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
TsExtractor |
setTsExtractorTimestampSearchBytes
@CanIgnoreReturnValue
synchronized fun setTsExtractorTimestampSearchBytes(timestampSearchBytes: Int): DefaultExtractorsFactory!
Sets the number of bytes searched to find a timestamp for TsExtractor instances created by the factory.
| Parameters | |
|---|---|
timestampSearchBytes: Int |
The number of search bytes to use. |
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
TsExtractor |
setTsSubtitleFormats
@CanIgnoreReturnValue
synchronized fun setTsSubtitleFormats(subtitleFormats: (Mutable)List<Format!>!): DefaultExtractorsFactory!
Sets a list of subtitle formats to pass to the DefaultTsPayloadReaderFactory used by TsExtractor instances created by the factory.
| Returns | |
|---|---|
DefaultExtractorsFactory! |
The factory, for convenience. |
| See also | |
|---|---|
DefaultTsPayloadReaderFactory |