Class SlidingWeightedAverageBandwidthStatistic
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.experimental.SlidingWeightedAverageBandwidthStatistic
-
- All Implemented Interfaces:
BandwidthStatistic
@Deprecated public class SlidingWeightedAverageBandwidthStatistic 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.ABandwidthStatisticthat calculates estimates based on a sliding window weighted average.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSlidingWeightedAverageBandwidthStatistic.SampleDeprecated.Represents a bandwidth sample.static interfaceSlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctionDeprecated.An interface to decide if samples need to be evicted from the estimator.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_SAMPLES_COUNTDeprecated.The default maximum number of samples.
-
Constructor Summary
Constructors Constructor Description SlidingWeightedAverageBandwidthStatistic()Deprecated.Creates an instance that keeps up toDEFAULT_MAX_SAMPLES_COUNTsamples.SlidingWeightedAverageBandwidthStatistic(SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction sampleEvictionFunction)Deprecated.Creates an instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddSample(long bytes, long durationUs)Deprecated.Adds a transfer sample to the statistic.static SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctiongetAgeBasedEvictionFunction(long maxAgeMs)Deprecated.Gets aSlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctionthat maintains samples up tomaxAgeMs.longgetBandwidthEstimate()Deprecated.Returns the bandwidth estimate in bits per second, orBandwidthEstimator.ESTIMATE_NOT_AVAILABLEif there is no estimate available yet.static SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctiongetMaxCountEvictionFunction(long maxSamplesCount)Deprecated.Gets aSlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctionthat maintains up tomaxSamplesCountsamples.voidreset()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
-
-
Constructor Detail
-
SlidingWeightedAverageBandwidthStatistic
public SlidingWeightedAverageBandwidthStatistic()
Deprecated.Creates an instance that keeps up toDEFAULT_MAX_SAMPLES_COUNTsamples.
-
SlidingWeightedAverageBandwidthStatistic
public SlidingWeightedAverageBandwidthStatistic(SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction sampleEvictionFunction)
Deprecated.Creates an instance.- Parameters:
sampleEvictionFunction- TheSlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctiondeciding whether to drop samples when new samples are added.
-
-
Method Detail
-
getMaxCountEvictionFunction
public static SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction getMaxCountEvictionFunction(long maxSamplesCount)
Deprecated.Gets aSlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctionthat maintains up tomaxSamplesCountsamples.
-
getAgeBasedEvictionFunction
public static SlidingWeightedAverageBandwidthStatistic.SampleEvictionFunction getAgeBasedEvictionFunction(long maxAgeMs)
Deprecated.Gets aSlidingWeightedAverageBandwidthStatistic.SampleEvictionFunctionthat maintains samples up tomaxAgeMs.
-
addSample
public void addSample(long bytes, long durationUs)Deprecated.Description copied from interface:BandwidthStatisticAdds a transfer sample to the statistic.- Specified by:
addSamplein 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:BandwidthStatisticReturns the bandwidth estimate in bits per second, orBandwidthEstimator.ESTIMATE_NOT_AVAILABLEif there is no estimate available yet.- Specified by:
getBandwidthEstimatein interfaceBandwidthStatistic
-
reset
public void reset()
Deprecated.Description copied from interface:BandwidthStatisticResets the statistic. The statistic should drop all samples and reset to its initial state, similar to right after construction.- Specified by:
resetin interfaceBandwidthStatistic
-
-