com.google.android.exoplayer.upstream.BandwidthMeter Java Examples
The following examples show how to use
com.google.android.exoplayer.upstream.BandwidthMeter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DemoPlayer.java From ShareBox with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {link RendererBuilder}. * * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #2
Source File: ExoplayerWrapper.java From google-media-framework-android with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param renderers Renderers indexed by {@link ExoplayerWrapper} TYPE_* constants. An * individual element may be null if there do not exist tracks of the * corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ public void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { // Normalize the results. if (trackNames == null) { trackNames = new String[RENDERER_COUNT][]; } for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; this.bandwidthMeter = bandwidthMeter; maybeReportPlayerState(); pushSurfaceAndVideoTrack(false); player.prepare(renderers); }
Example #3
Source File: DemoPlayer.java From talk-android with MIT License | 6 votes |
/** * Invoked with the results from a {link RendererBuilder}. * * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #4
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #5
Source File: DemoPlayer.java From androidtv-sample-inputs with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding * type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be * null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.audioRenderer = renderers[TYPE_AUDIO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #6
Source File: DemoPlayer.java From WliveTV with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {link RendererBuilder}. * * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #7
Source File: DemoPlayer.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #8
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param renderers Renderers indexed by {@link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #9
Source File: DemoPlayer.java From AndroidTvDemo with Apache License 2.0 | 6 votes |
/** * Invoked with the results from a {link RendererBuilder}. * * @param renderers Renderers indexed by {link DemoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.bandwidthMeter = bandwidthMeter; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #10
Source File: ExVidPlayerImp.java From ExVidPlayer with Apache License 2.0 | 5 votes |
public void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < renderers.length; i++) { if (renderers[i] == null) { renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; pushSurface(false); player.prepare(renderers); player.setPlayWhenReady(true); }
Example #11
Source File: VideoPlayer.java From iview-android-tv with MIT License | 5 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param trackNames The names of the available tracks, indexed by {@link VideoPlayer} TYPE_* * constants. May be null if the track names are unknown. An individual element may be null * if the track names are unknown for the corresponding type. * @param multiTrackSources Sources capable of switching between multiple available tracks, * indexed by {@link VideoPlayer} TYPE_* constants. May be null if there are no types with * multiple tracks. An individual element may be null if it does not have multiple tracks. * @param renderers Renderers indexed by {@link VideoPlayer} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be null. */ /* package */ void onRenderers(String[][] trackNames, MultiTrackChunkSource[] multiTrackSources, TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { // Normalize the results. if (trackNames == null) { trackNames = new String[RENDERER_COUNT][]; } if (multiTrackSources == null) { multiTrackSources = new MultiTrackChunkSource[RENDERER_COUNT]; } for (int rendererIndex = 0; rendererIndex < RENDERER_COUNT; rendererIndex++) { if (renderers[rendererIndex] == null) { // Convert a null renderer to a dummy renderer. renderers[rendererIndex] = new DummyTrackRenderer(); } if (trackNames[rendererIndex] == null) { // Convert a null trackNames to an array of suitable length. int trackCount = multiTrackSources[rendererIndex] != null ? multiTrackSources[rendererIndex].getTrackCount() : 1; trackNames[rendererIndex] = new String[trackCount]; } } // Complete preparation. this.trackNames = trackNames; this.videoRenderer = renderers[TYPE_VIDEO]; this.codecCounters = videoRenderer instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) videoRenderer).codecCounters : renderers[TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[TYPE_AUDIO]).codecCounters : null; this.multiTrackSources = multiTrackSources; this.bandwidthMeter = bandwidthMeter; pushSurface(false); pushTrackSelection(TYPE_VIDEO, true); pushTrackSelection(TYPE_AUDIO, true); pushTrackSelection(TYPE_TEXT, true); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #12
Source File: FormatEvaluator.java From Exoplayer_VLC with Apache License 2.0 | 5 votes |
/** * @param bandwidthMeter Provides an estimate of the currently available bandwidth. */ public AdaptiveEvaluator(BandwidthMeter bandwidthMeter) { this (bandwidthMeter, DEFAULT_MAX_INITIAL_BITRATE, DEFAULT_MIN_DURATION_FOR_QUALITY_INCREASE_MS, DEFAULT_MAX_DURATION_FOR_QUALITY_DECREASE_MS, DEFAULT_MIN_DURATION_TO_RETAIN_AFTER_DISCARD_MS, DEFAULT_BANDWIDTH_FRACTION); }
Example #13
Source File: Player.java From exoplayer-textureview with Apache License 2.0 | 5 votes |
/** * Invoked with the results from a {@link RendererBuilder}. * * @param renderers Renderers indexed by {@link Player} TYPE_* constants. An individual * element may be null if there do not exist tracks of the corresponding * type. * @param bandwidthMeter Provides an estimate of the currently available bandwidth. May be * null. */ void invokeOnRenderersBuilt(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { for (int i = 0; i < RENDERER_COUNT; i++) { if (renderers[i] == null) { // Convert a null renderer to a dummy renderer. renderers[i] = new DummyTrackRenderer(); } } // Complete preparation. this.videoRenderer = renderers[TYPE_VIDEO]; pushSurface(false); player.prepare(renderers); rendererBuildingState = RENDERER_BUILDING_STATE_BUILT; }
Example #14
Source File: EventProxy.java From exoplayer-textureview with Apache License 2.0 | 5 votes |
/** RendererBuilderCallback */ @Override public void onRenderers(TrackRenderer[] renderers, BandwidthMeter bandwidthMeter) { player.invokeOnRenderersBuilt(renderers, bandwidthMeter); this.bandwidthMeter = bandwidthMeter; this.codecCounters = renderers[Player.TYPE_VIDEO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[Player.TYPE_VIDEO]).codecCounters : renderers[Player.TYPE_AUDIO] instanceof MediaCodecTrackRenderer ? ((MediaCodecTrackRenderer) renderers[Player.TYPE_AUDIO]).codecCounters : null; }
Example #15
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #16
Source File: HlsChunkSource.java From Exoplayer_VLC with Apache License 2.0 | 4 votes |
/** * @param dataSource A {@link DataSource} suitable for loading the media data. * @param playlistUrl The playlist URL. * @param playlist The hls playlist. * @param bandwidthMeter provides an estimate of the currently available bandwidth. * @param variantIndices A subset of variant indices to consider, or null to consider all of the * variants in the master playlist. * @param adaptiveMode The mode for switching from one variant to another. One of * {@link #ADAPTIVE_MODE_NONE}, {@link #ADAPTIVE_MODE_ABRUPT} and * {@link #ADAPTIVE_MODE_SPLICE}. * @param targetBufferSize The targeted buffer size in bytes. The buffer will not be filled more * than one chunk beyond this amount of data. * @param targetBufferDurationMs The targeted duration of media to buffer ahead of the current * playback position. The buffer will not be filled more than one chunk beyond this position. * @param minBufferDurationToSwitchUpMs The minimum duration of media that needs to be buffered * for a switch to a higher quality variant to be considered. * @param maxBufferDurationToSwitchDownMs The maximum duration of media that needs to be buffered * for a switch to a lower quality variant to be considered. */ public HlsChunkSource(DataSource dataSource, String playlistUrl, HlsPlaylist playlist, BandwidthMeter bandwidthMeter, int[] variantIndices, int adaptiveMode, int targetBufferSize, long targetBufferDurationMs, long minBufferDurationToSwitchUpMs, long maxBufferDurationToSwitchDownMs) { this.upstreamDataSource = dataSource; this.bandwidthMeter = bandwidthMeter; this.adaptiveMode = adaptiveMode; this.targetBufferSize = targetBufferSize; targetBufferDurationUs = targetBufferDurationMs * 1000; minBufferDurationToSwitchUpUs = minBufferDurationToSwitchUpMs * 1000; maxBufferDurationToSwitchDownUs = maxBufferDurationToSwitchDownMs * 1000; baseUri = playlist.baseUri; playlistParser = new HlsPlaylistParser(); bufferPool = new BufferPool(256 * 1024); if (playlist.type == HlsPlaylist.TYPE_MEDIA) { enabledVariants = new Variant[] {new Variant(0, playlistUrl, 0, null, -1, -1)}; mediaPlaylists = new HlsMediaPlaylist[1]; mediaPlaylistBlacklistFlags = new boolean[1]; lastMediaPlaylistLoadTimesMs = new long[1]; setMediaPlaylist(0, (HlsMediaPlaylist) playlist); } else { Assertions.checkState(playlist.type == HlsPlaylist.TYPE_MASTER); enabledVariants = filterVariants((HlsMasterPlaylist) playlist, variantIndices); mediaPlaylists = new HlsMediaPlaylist[enabledVariants.length]; mediaPlaylistBlacklistFlags = new boolean[enabledVariants.length]; lastMediaPlaylistLoadTimesMs = new long[enabledVariants.length]; } int maxWidth = -1; int maxHeight = -1; // Select the first variant from the master playlist that's enabled. long minOriginalVariantIndex = Integer.MAX_VALUE; for (int i = 0; i < enabledVariants.length; i++) { if (enabledVariants[i].index < minOriginalVariantIndex) { minOriginalVariantIndex = enabledVariants[i].index; variantIndex = i; } maxWidth = Math.max(enabledVariants[i].width, maxWidth); maxHeight = Math.max(enabledVariants[i].height, maxHeight); } // TODO: We should allow the default values to be passed through the constructor. this.maxWidth = maxWidth > 0 ? maxWidth : 1920; this.maxHeight = maxHeight > 0 ? maxHeight : 1080; }
Example #17
Source File: FormatEvaluator.java From Exoplayer_VLC with Apache License 2.0 | 4 votes |
/** * Apply overhead factor, or default value in absence of estimate. */ protected long computeEffectiveBitrateEstimate(long bitrateEstimate) { return bitrateEstimate == BandwidthMeter.NO_ESTIMATE ? maxInitialBitrate : (long) (bitrateEstimate * bandwidthFraction); }
Example #18
Source File: EventProxy.java From exoplayer-textureview with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #19
Source File: DemoPlayer.java From androidtv-sample-inputs with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #20
Source File: ExoplayerWrapper.java From google-media-framework-android with Apache License 2.0 | 4 votes |
public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #21
Source File: HlsChunkSource.java From Exoplayer_VLC with Apache License 2.0 | 4 votes |
public HlsChunkSource(DataSource dataSource, String playlistUrl, HlsPlaylist playlist, BandwidthMeter bandwidthMeter, int[] variantIndices, int adaptiveMode) { this(dataSource, playlistUrl, playlist, bandwidthMeter, variantIndices, adaptiveMode, DEFAULT_TARGET_BUFFER_SIZE, DEFAULT_TARGET_BUFFER_DURATION_MS, DEFAULT_MIN_BUFFER_TO_SWITCH_UP_MS, DEFAULT_MAX_BUFFER_TO_SWITCH_DOWN_MS); }
Example #22
Source File: VideoPlayer.java From iview-android-tv with MIT License | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #23
Source File: HlsChunkSourceCreator.java From exoplayer-textureview with Apache License 2.0 | 4 votes |
HlsChunkSource create(DataSource dataSource, HlsPlaylist playlist, BandwidthMeter bandwidthMeter, PtsTimestampAdjusterProvider timestampAdjusterProvider, int[] variantIndices);
Example #24
Source File: DemoPlayer.java From Android-Example-HLS-ExoPlayer with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #25
Source File: DemoPlayer.java From WliveTV with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #26
Source File: DemoPlayer.java From droidkaigi2016 with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #27
Source File: DemoPlayer.java From talk-android with MIT License | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #28
Source File: DemoPlayer.java From ShareBox with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #29
Source File: DemoPlayer.java From AndroidTvDemo with Apache License 2.0 | 4 votes |
@Override public BandwidthMeter getBandwidthMeter() { return bandwidthMeter; }
Example #30
Source File: FormatEvaluator.java From Exoplayer_VLC with Apache License 2.0 | 3 votes |
/** * @param bandwidthMeter Provides an estimate of the currently available bandwidth. * @param maxInitialBitrate The maximum bitrate in bits per second that should be assumed * when bandwidthMeter cannot provide an estimate due to playback having only just started. * @param minDurationForQualityIncreaseMs The minimum duration of buffered data required for * the evaluator to consider switching to a higher quality format. * @param maxDurationForQualityDecreaseMs The maximum duration of buffered data required for * the evaluator to consider switching to a lower quality format. * @param minDurationToRetainAfterDiscardMs When switching to a significantly higher quality * format, the evaluator may discard some of the media that it has already buffered at the * lower quality, so as to switch up to the higher quality faster. This is the minimum * duration of media that must be retained at the lower quality. * @param bandwidthFraction The fraction of the available bandwidth that the evaluator should * consider available for use. Setting to a value less than 1 is recommended to account * for inaccuracies in the bandwidth estimator. */ public AdaptiveEvaluator(BandwidthMeter bandwidthMeter, int maxInitialBitrate, int minDurationForQualityIncreaseMs, int maxDurationForQualityDecreaseMs, int minDurationToRetainAfterDiscardMs, float bandwidthFraction) { this.bandwidthMeter = bandwidthMeter; this.maxInitialBitrate = maxInitialBitrate; this.minDurationForQualityIncreaseUs = minDurationForQualityIncreaseMs * 1000L; this.maxDurationForQualityDecreaseUs = maxDurationForQualityDecreaseMs * 1000L; this.minDurationToRetainAfterDiscardUs = minDurationToRetainAfterDiscardMs * 1000L; this.bandwidthFraction = bandwidthFraction; }