docs/doc/reference/com/google/android/exoplayer2/source/FilteringMediaSource.html
Package com.google.android.exoplayer2.source
All Implemented Interfaces:MediaSource
[@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.
-
MediaSource.Factory, MediaSource.MediaPeriodId, MediaSource.MediaSourceCaller
-
mediaSource
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.
|
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.
|
-
disableChildSource, enableChildSource, getInitialTimeline, getMediaItem, getMediaPeriodIdForChildMediaPeriodId, getMediaPeriodIdForChildMediaPeriodId, getMediaTimeForChildMediaTime, getMediaTimeForChildMediaTime, getWindowIndexForChildWindowIndex, getWindowIndexForChildWindowIndex, isSingleWindow, onChildSourceInfoRefreshed, onChildSourceInfoRefreshed, prepareChildSource, prepareSourceInternal, prepareSourceInternal, releaseChildSource
-
disableChildSource, disableInternal, enableChildSource, enableInternal, maybeThrowSourceInfoRefreshError, prepareChildSource, releaseChildSource, releaseSourceInternal
-
addDrmEventListener, addEventListener, createDrmEventDispatcher, createDrmEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, createEventDispatcher, disable, enable, getPlayerId, isEnabled, prepareSource, prepareSource, refreshSourceInfo, releaseSource, removeDrmEventListener, removeEventListener
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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.
-
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.
-
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)
-
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)