Back to Exoplayer

ExponentialWeightedAverageStatistic (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/experimental/ExponentialWeightedAverageStatistic.html

latest4.6 KB
Original Source

Package com.google.android.exoplayer2.upstream.experimental

Class ExponentialWeightedAverageStatistic

  • java.lang.Object

    • com.google.android.exoplayer2.upstream.experimental.ExponentialWeightedAverageStatistic
  • All Implemented Interfaces:BandwidthStatistic


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public classExponentialWeightedAverageStatisticextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[BandwidthStatistic](BandwidthStatistic.html "interface in com.google.android.exoplayer2.upstream.experimental")

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 BandwidthStatistic that calculates estimates using an exponential weighted average.

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static double | DEFAULT_SMOOTHING_FACTOR | Deprecated.

The default smoothing factor. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | ExponentialWeightedAverageStatistic() | Deprecated.

Creates an instance with DEFAULT_SMOOTHING_FACTOR. | | ExponentialWeightedAverageStatistic​(double smoothingFactor) | 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, or BandwidthEstimator.ESTIMATE_NOT_AVAILABLE if there is no estimate available yet. | | void | reset() | Deprecated.

Resets the statistic. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

DEFAULT_SMOOTHING_FACTOR

public static final double DEFAULT_SMOOTHING_FACTOR

Deprecated.

The default smoothing factor. See Also:Constant Field Values

Constructor Detail

- 

ExponentialWeightedAverageStatistic

public ExponentialWeightedAverageStatistic()

Deprecated.

Creates an instance with DEFAULT_SMOOTHING_FACTOR.

- 

ExponentialWeightedAverageStatistic

public ExponentialWeightedAverageStatistic​(double smoothingFactor)

Deprecated.

Creates an instance. Parameters:smoothingFactor - The exponential smoothing factor.

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 interface BandwidthStatisticParameters: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, or BandwidthEstimator.ESTIMATE_NOT_AVAILABLE if there is no estimate available yet. Specified by:getBandwidthEstimate in interface BandwidthStatistic

- 

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 interface BandwidthStatistic