# SplitParallelSampleBandwidthEstimator

# SplitParallelSampleBandwidthEstimator

Artifact:[androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator.java+class:androidx.media3.exoplayer.upstream.experimental.SplitParallelSampleBandwidthEstimator)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator "View this page in Java")

<br />

```
@UnstableApi
class SplitParallelSampleBandwidthEstimator : BandwidthEstimator
```

<br />

*** ** * ** ***

A[BandwidthEstimator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/BandwidthEstimator)that captures a transfer sample each time a transfer ends. When parallel transfers are happening at the same time, the transferred bytes are aggregated in a single sample.

## Summary

|                                                                                                                                                                                                 ### Nested types                                                                                                                                                                                                 |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[SplitParallelSampleBandwidthEstimator.Builder](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator.Builder) A builder to create[SplitParallelSampleBandwidthEstimator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator)instances. |

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [addEventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#addEventListener(android.os.Handler,androidx.media3.exoplayer.upstream.BandwidthMeter.EventListener))`(` ` eventHandler: `[Handler](https://developer.android.com/reference/android/os/Handler.html)`!,` ` eventListener: `[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener)`!` `)` Adds an[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener). |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onBytesTransferred](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#onBytesTransferred(androidx.media3.datasource.DataSource,int))`(source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!, bytesTransferred: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called incrementally during a transfer.                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onNetworkTypeChange](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#onNetworkTypeChange(long))`(newBandwidthEstimate: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Notifies this estimator that a network change has been detected.                                                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTransferEnd](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#onTransferEnd(androidx.media3.datasource.DataSource))`(source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!)` Called when a transfer ends.                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTransferInitializing](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#onTransferInitializing(androidx.media3.datasource.DataSource))`(source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!)` Called when a transfer is being initialized.                                                                                                                                                                                                                                                                                                      |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [onTransferStart](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#onTransferStart(androidx.media3.datasource.DataSource))`(source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!)` Called when a transfer starts.                                                                                                                                                                                                                                                                                                                                  |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [removeEventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#removeEventListener(androidx.media3.exoplayer.upstream.BandwidthMeter.EventListener))`(eventListener: `[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener)`!)` Removes an[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener).                                                                                                                  |

|                             ### Public properties                             |
|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [bandwidthEstimate](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/SplitParallelSampleBandwidthEstimator#bandwidthEstimate()) |

|                                                                                                                                                                                                                                                                                                                                                                             ### Inherited Constants                                                                                                                                                                                                                                                                                                                                                                             |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.exoplayer.upstream.experimental.BandwidthEstimator](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/BandwidthEstimator) |---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `const `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [ESTIMATE_NOT_AVAILABLE](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/experimental/BandwidthEstimator#ESTIMATE_NOT_AVAILABLE())` = -9223372036854775808` | |

## Public functions

### addEventListener

```
fun addEventListener(
    eventHandler: Handler!,
    eventListener: BandwidthMeter.EventListener!
): Unit
```

Adds an[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener).  

|                                                                             Parameters                                                                             |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| `eventHandler: `[Handler](https://developer.android.com/reference/android/os/Handler.html)`!`                                                                      | A handler for events. |
| `eventListener: `[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener)`!` | A listener of events. |

### onBytesTransferred

```
fun onBytesTransferred(source: DataSource!, bytesTransferred: Int): Unit
```

Called incrementally during a transfer.  

|                                                   Parameters                                                    |
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!` | The[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)performing the transfer. |
| `bytesTransferred: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                 | The number of bytes transferred since the previous call to this method                                                        |

### onNetworkTypeChange

```
fun onNetworkTypeChange(newBandwidthEstimate: Long): Unit
```

Notifies this estimator that a network change has been detected.  

|                                              Parameters                                               |
|-------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|
| `newBandwidthEstimate: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | The new initial bandwidth estimate based on network type. |

### onTransferEnd

```
fun onTransferEnd(source: DataSource!): Unit
```

Called when a transfer ends.  

|                                                   Parameters                                                    |
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!` | The[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)performing the transfer. |

### onTransferInitializing

```
fun onTransferInitializing(source: DataSource!): Unit
```

Called when a transfer is being initialized.  

|                                                   Parameters                                                    |
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!` | The[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)performing the transfer. |

### onTransferStart

```
fun onTransferStart(source: DataSource!): Unit
```

Called when a transfer starts.  

|                                                   Parameters                                                    |
|-----------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
| `source: `[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)`!` | The[DataSource](https://developer.android.com/reference/kotlin/androidx/media3/datasource/DataSource)performing the transfer. |

### removeEventListener

```
fun removeEventListener(eventListener: BandwidthMeter.EventListener!): Unit
```

Removes an[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener).  

|                                                                             Parameters                                                                             |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| `eventListener: `[BandwidthMeter.EventListener](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/upstream/BandwidthMeter.EventListener)`!` | The listener to be removed. |

## Public properties

### bandwidthEstimate

```
val bandwidthEstimate: Long
```