public static final class DefaultBandwidthMeter.Builder extends Object
Constructor and Description |
---|
Builder()
Deprecated.
Use
#Builder(Context) instead. |
Builder(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 |
setEventListener(Handler eventHandler,
BandwidthMeter.EventListener eventListener)
Sets an event listener for new bandwidth estimates.
|
DefaultBandwidthMeter.Builder |
setInitialBitrateEstimate(int networkType,
long initialBitrateEstimate)
Sets the initial bitrate estimate in bits per second for a network type 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(String countryCode)
Sets the initial bitrate estimates to the default values of the specified country.
|
DefaultBandwidthMeter.Builder |
setSlidingWindowMaxWeight(int slidingWindowMaxWeight)
Sets the maximum weight for the sliding window.
|
@Deprecated public Builder()
#Builder(Context)
instead.public DefaultBandwidthMeter.Builder setEventListener(Handler eventHandler, BandwidthMeter.EventListener eventListener)
eventHandler
- A handler for events.eventListener
- A listener of events.IllegalArgumentException
- If the event handler or listener are null.public DefaultBandwidthMeter.Builder setSlidingWindowMaxWeight(int slidingWindowMaxWeight)
slidingWindowMaxWeight
- The maximum weight for the sliding window.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(long initialBitrateEstimate)
initialBitrateEstimate
- The initial bitrate estimate in bits per second.public DefaultBandwidthMeter.Builder setInitialBitrateEstimate(@C.NetworkType 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(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 build()