Class SlidingPercentileBandwidthStatistic
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.experimental.SlidingPercentileBandwidthStatistic
-
- All Implemented Interfaces:
BandwidthStatistic
@Deprecated public class SlidingPercentileBandwidthStatistic extends Object implements BandwidthStatistic
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.ABandwidthStatistic
that calculates estimates based on a sliding window weighted percentile.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_SAMPLES_COUNT
Deprecated.The default maximum number of samples.static double
DEFAULT_PERCENTILE
Deprecated.The default percentile to return.
-
Constructor Summary
Constructors Constructor Description SlidingPercentileBandwidthStatistic()
Deprecated.Creates an instance with a maximum ofDEFAULT_MAX_SAMPLES_COUNT
samples, returning theDEFAULT_PERCENTILE
.SlidingPercentileBandwidthStatistic(int maxSampleCount, double percentile)
Deprecated.Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addSample(long bytes, long durationUs)
Deprecated.Adds a transfer sample to the statistic.long
getBandwidthEstimate()
Deprecated.Returns the bandwidth estimate in bits per second, orBandwidthEstimator.ESTIMATE_NOT_AVAILABLE
if there is no estimate available yet.void
reset()
Deprecated.Resets the statistic.
-
-
-
Field Detail
-
DEFAULT_MAX_SAMPLES_COUNT
public static final int DEFAULT_MAX_SAMPLES_COUNT
Deprecated.The default maximum number of samples.- See Also:
- Constant Field Values
-
DEFAULT_PERCENTILE
public static final double DEFAULT_PERCENTILE
Deprecated.The default percentile to return.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SlidingPercentileBandwidthStatistic
public SlidingPercentileBandwidthStatistic()
Deprecated.Creates an instance with a maximum ofDEFAULT_MAX_SAMPLES_COUNT
samples, returning theDEFAULT_PERCENTILE
.
-
SlidingPercentileBandwidthStatistic
public SlidingPercentileBandwidthStatistic(int maxSampleCount, double percentile)
Deprecated.Creates an instance.- Parameters:
maxSampleCount
- The maximum number of samples.percentile
- The percentile to return. Must be in the range of [0-1].
-
-
Method Detail
-
addSample
public void addSample(long bytes, long durationUs)
Deprecated.Description copied from interface:BandwidthStatistic
Adds a transfer sample to the statistic.- Specified by:
addSample
in interfaceBandwidthStatistic
- Parameters:
bytes
- The number of bytes transferred.durationUs
- The duration of the transfer, in microseconds.
-
getBandwidthEstimate
public long getBandwidthEstimate()
Deprecated.Description copied from interface:BandwidthStatistic
Returns the bandwidth estimate in bits per second, orBandwidthEstimator.ESTIMATE_NOT_AVAILABLE
if there is no estimate available yet.- Specified by:
getBandwidthEstimate
in interfaceBandwidthStatistic
-
reset
public void reset()
Deprecated.Description copied from interface:BandwidthStatistic
Resets the statistic. The statistic should drop all samples and reset to its initial state, similar to right after construction.- Specified by:
reset
in interfaceBandwidthStatistic
-
-