public static final class DefaultBandwidthMeter.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder(android.content.Context context)
Creates a builder with default parameters and without listener.
|
| Modifier and Type | Method and Description |
|---|---|
DefaultBandwidthMeter |
build()
Builds the bandwidth meter.
|
DefaultBandwidthMeter.Builder |
setClock(Clock clock)
Sets the clock used to estimate bandwidth from data transfers.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(int networkType,
long initialBitrateEstimate)
Sets the initial bitrate estimate in bits per second that should be assumed when a bandwidth
estimate is unavailable and the current network connection is of the specified type.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(long initialBitrateEstimate)
Sets the initial bitrate estimate in bits per second that should be assumed when a bandwidth
estimate is unavailable.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(java.lang.String countryCode)
Sets the initial bitrate estimates to the default values of the specified country.
|
DefaultBandwidthMeter.Builder |
setResetOnNetworkTypeChange(boolean resetOnNetworkTypeChange)
Sets whether to reset if the network type changes.
|
DefaultBandwidthMeter.Builder |
setSlideWindowPercentile(float percentile) |
DefaultBandwidthMeter.Builder |
setSlidingWindowMaxWeight(int slidingWindowMaxWeight)
Sets the maximum weight for the sliding window.
|
public Builder(android.content.Context context)
context - A context.public DefaultBandwidthMeter.Builder setSlidingWindowMaxWeight(int slidingWindowMaxWeight)
slidingWindowMaxWeight - The maximum weight for the sliding window.public DefaultBandwidthMeter.Builder setSlideWindowPercentile(float percentile)
public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(long initialBitrateEstimate)
initialBitrateEstimate - The initial bitrate estimate in bits per second.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(int networkType, long initialBitrateEstimate)
networkType - The C.NetworkType this initial estimate is for.initialBitrateEstimate - The initial bitrate estimate in bits per second.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(java.lang.String countryCode)
countryCode - The ISO 3166-1 alpha-2 country code of the country whose default bitrate
estimates should be used.public DefaultBandwidthMeter.Builder setClock(Clock clock)
clock - The clock used to estimate bandwidth from data transfers.public DefaultBandwidthMeter.Builder setResetOnNetworkTypeChange(boolean resetOnNetworkTypeChange)
true.resetOnNetworkTypeChange - Whether to reset if the network type changes.public DefaultBandwidthMeter build()