Back to Exoplayer

FilteringMediaSource (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/FilteringMediaSource.html

latest9.1 KB
Original Source

Package com.google.android.exoplayer2.source

Class FilteringMediaSource


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classFilteringMediaSourceextends[WrappingMediaSource](WrappingMediaSource.html "class in com.google.android.exoplayer2.source")

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.

A MediaSource that filters the available track types.

Media sources loading muxed media, e.g. progressive streams with muxed video and audio, are still likely to parse all of these streams even if the tracks are not made available to the player.

Nested Class Summary

- 

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

MediaSource.Factory, MediaSource.MediaPeriodId, MediaSource.MediaSourceCaller

Field Summary

- 

Fields inherited from class com.google.android.exoplayer2.source.WrappingMediaSource

mediaSource

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | FilteringMediaSource​(MediaSource mediaSource, @com.google.android.exoplayer2.C.TrackType int trackType) | Deprecated.

Creates a filtering MediaSource that only publishes tracks of one type. | | FilteringMediaSource​(MediaSource mediaSource, Set<@TrackType Integer> trackTypes) | Deprecated.

Creates a filtering MediaSource that only publishes tracks of the given types. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | MediaPeriod | createPeriod​(MediaSource.MediaPeriodId id, Allocator allocator, long startPositionUs) | Deprecated.

Creates the requested MediaPeriod. | | void | releasePeriod​(MediaPeriod mediaPeriod) | Deprecated.

Releases a MediaPeriod. |

- 

Methods inherited from class com.google.android.exoplayer2.source.WrappingMediaSource

disableChildSource, enableChildSource, getInitialTimeline, getMediaItem, getMediaPeriodIdForChildMediaPeriodId, getMediaPeriodIdForChildMediaPeriodId, getMediaTimeForChildMediaTime, getMediaTimeForChildMediaTime, getWindowIndexForChildWindowIndex, getWindowIndexForChildWindowIndex, isSingleWindow, onChildSourceInfoRefreshed, onChildSourceInfoRefreshed, prepareChildSource, prepareSourceInternal, prepareSourceInternal, releaseChildSource

- 

Methods inherited from class com.google.android.exoplayer2.source.CompositeMediaSource

disableChildSource, disableInternal, enableChildSource, enableInternal, maybeThrowSourceInfoRefreshError, prepareChildSource, releaseChildSource, releaseSourceInternal

- 

Methods inherited from class com.google.android.exoplayer2.source.BaseMediaSource

addDrmEventListener, addEventListener, createDrmEventDispatcher, createDrmEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, disable, enable, getPlayerId, isEnabled, prepareSource, prepareSource, refreshSourceInfo, releaseSource, removeDrmEventListener, removeEventListener

- 

Methods inherited from class java.lang.Object

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

Constructor Detail

- 

FilteringMediaSource

public FilteringMediaSource​([MediaSource](MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource,
                            @com.google.android.exoplayer2.C.TrackType int trackType)

Deprecated.

Creates a filtering MediaSource that only publishes tracks of one type. Parameters:mediaSource - The wrapped MediaSource.trackType - The only C.TrackType to provide from this source.

- 

FilteringMediaSource

public FilteringMediaSource​([MediaSource](MediaSource.html "interface in com.google.android.exoplayer2.source")mediaSource,[Set](https://developer.android.com/reference/java/util/Set.html "class or interface in java.util")<[@TrackType](../C.TrackType.html "annotation in com.google.android.exoplayer2")[Integer](https://developer.android.com/reference/java/lang/Integer.html?is-external=true "class or interface in java.lang")> trackTypes)

Deprecated.

Creates a filtering MediaSource that only publishes tracks of the given types. Parameters:mediaSource - The wrapped MediaSource.trackTypes - The track types to provide from this source.

Method Detail

- 

createPeriod

public[MediaPeriod](MediaPeriod.html "interface in com.google.android.exoplayer2.source")createPeriod​([MediaSource.MediaPeriodId](MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")id,[Allocator](../upstream/Allocator.html "interface in com.google.android.exoplayer2.upstream")allocator,
                                long startPositionUs)

Deprecated.

Description copied from class: WrappingMediaSource

Creates the requested MediaPeriod.

This method typically forwards to the wrapped media source and optionally wraps the returned MediaPeriod.

Specified by:createPeriod in interface MediaSourceOverrides:createPeriod in class WrappingMediaSourceParameters:id - The identifier of the period.allocator - An Allocator from which to obtain media buffer allocations.startPositionUs - The expected start position, in microseconds.Returns:A new MediaPeriod.See Also:MediaSource.createPeriod(MediaPeriodId, Allocator, long)

- 

releasePeriod

public void releasePeriod​([MediaPeriod](MediaPeriod.html "interface in com.google.android.exoplayer2.source")mediaPeriod)

Deprecated.

Description copied from class: WrappingMediaSource

Releases a MediaPeriod.

This method typically forwards to the wrapped media source and optionally unwraps the provided MediaPeriod.

Specified by:releasePeriod in interface MediaSourceOverrides:releasePeriod in class WrappingMediaSourceParameters:mediaPeriod - The period to release.See Also:MediaSource.releasePeriod(MediaPeriod)