FilteringMediaSource
@UnstableApi
public class FilteringMediaSource extends WrappingMediaSource
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.
Summary
Public constructors |
|---|
FilteringMediaSource(MediaSource mediaSource, @C.TrackType int trackType)Creates a filtering |
FilteringMediaSource(Creates a filtering |
Public methods |
|
|---|---|
MediaPeriod |
createPeriod(Creates the requested |
void |
releasePeriod(MediaPeriod mediaPeriod)Releases a |
Inherited fields |
||
|---|---|---|
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
|
Public constructors
FilteringMediaSource
public FilteringMediaSource(MediaSource mediaSource, @C.TrackType int trackType)
Creates a filtering MediaSource that only publishes tracks of one type.
| Parameters | |
|---|---|
MediaSource mediaSource |
The wrapped |
@C.TrackType int trackType |
The only |
FilteringMediaSource
public FilteringMediaSource(
MediaSource mediaSource,
Set<@C.TrackType Integer> trackTypes
)
Creates a filtering MediaSource that only publishes tracks of the given types.
| Parameters | |
|---|---|
MediaSource mediaSource |
The wrapped |
Set<@C.TrackType Integer> trackTypes |
The |
Public methods
createPeriod
public MediaPeriod createPeriod(
MediaSource.MediaPeriodId id,
Allocator allocator,
long startPositionUs
)
Creates the requested MediaPeriod.
This method typically forwards to the wrapped media source and optionally wraps the returned MediaPeriod.
| See also | |
|---|---|
createPeriod |
releasePeriod
public void releasePeriod(MediaPeriod mediaPeriod)
Releases a MediaPeriod.
This method typically forwards to the wrapped media source and optionally unwraps the provided MediaPeriod.
| See also | |
|---|---|
releasePeriod |