# DecoderCountersUtil

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

*** ** * ** ***


```
@UnstableApi
class DecoderCountersUtil
```

<br />

*** ** * ** ***

Assertions for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters`.

## Summary

| ### Public functions |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertConsecutiveDroppedBufferLimit(java.lang.String,androidx.media3.exoplayer.DecoderCounters,int)( name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!, limit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertDroppedBufferLimit(java.lang.String,androidx.media3.exoplayer.DecoderCounters,int)( name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!, limit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertSkippedOutputBufferCount(java.lang.String,androidx.media3.exoplayer.DecoderCounters,int)( name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!, expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Asserts that the skipped output buffer count is `expected`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertSkippedOutputBufferCount(java.lang.String,androidx.media3.exoplayer.DecoderCounters,int,int)( name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!, expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, tolerance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Asserts that the skipped output buffer count is within `tolerance` of `expected`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertTotalBufferCount(java.lang.String,androidx.media3.exoplayer.DecoderCounters)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!)` Asserts that the input and output values in `counters` are self-consistent. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertTotalBufferCount(java.lang.String,androidx.media3.exoplayer.DecoderCounters,int,int)( name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!, minCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#assertVideoFrameProcessingOffsetSampleCount(java.lang.String,androidx.media3.exoplayer.DecoderCounters,int,int)( name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!, minCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, maxCount: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/test/utils/DecoderCountersUtil#getTotalBufferCount(androidx.media3.exoplayer.DecoderCounters)(counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!)` Returns the sum of the skipped, dropped and rendered buffers. |

## Public functions

### assertConsecutiveDroppedBufferLimit

```
java-static fun assertConsecutiveDroppedBufferLimit(
    name: String!,
    counters: DecoderCounters!,
    limit: Int
): Unit
```

### assertDroppedBufferLimit

```
java-static fun assertDroppedBufferLimit(
    name: String!,
    counters: DecoderCounters!,
    limit: Int
): Unit
```

### assertSkippedOutputBufferCount

```
java-static fun assertSkippedOutputBufferCount(
    name: String!,
    counters: DecoderCounters!,
    expected: Int
): Unit
```

Asserts that the skipped output buffer count is `expected`.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the decoder. |
| `counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!` | The decoder counters. |
| `expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The expected number of skipped output buffers. |

### assertSkippedOutputBufferCount

```
java-static fun assertSkippedOutputBufferCount(
    name: String!,
    counters: DecoderCounters!,
    expected: Int,
    tolerance: Int
): Unit
```

Asserts that the skipped output buffer count is within `tolerance` of `expected`.

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the decoder. |
| `counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!` | The decoder counters. |
| `expected: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The expected number of skipped output buffers. |
| `tolerance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The allowed tolerance around the expected count. |

### assertTotalBufferCount

```
java-static fun assertTotalBufferCount(name: String!, counters: DecoderCounters!): Unit
```

Asserts that the input and output values in `counters` are self-consistent.

### assertTotalBufferCount

```
java-static fun assertTotalBufferCount(
    name: String!,
    counters: DecoderCounters!,
    minCount: Int,
    maxCount: Int
): Unit
```

### assertVideoFrameProcessingOffsetSampleCount

```
java-static fun assertVideoFrameProcessingOffsetSampleCount(
    name: String!,
    counters: DecoderCounters!,
    minCount: Int,
    maxCount: Int
): Unit
```

### getTotalBufferCount

```
java-static fun getTotalBufferCount(counters: DecoderCounters!): Int
```

Returns the sum of the skipped, dropped and rendered buffers.

| Parameters |
|---|---|
| `counters: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderCounters!` | The counters for which the total should be calculated. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The sum of the skipped, dropped and rendered buffers. |