# DecoderReuseEvaluation

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/DecoderReuseEvaluation.java+class:androidx.media3.exoplayer.DecoderReuseEvaluation)

*** ** * ** ***


```
@UnstableApi
class DecoderReuseEvaluation
```

<br />

*** ** * ** ***

The result of an evaluation to determine whether a decoder can be reused for a new input format.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(flag = true, value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons` Possible reasons why reuse is not possible. |
| `@https://developer.android.com/reference/java/lang/annotation/Documented.html @https://developer.android.com/reference/java/lang/annotation/Retention.html(value = https://developer.android.com/reference/java/lang/annotation/RetentionPolicy.html#SOURCE) @https://developer.android.com/reference/java/lang/annotation/Target.html(value = https://developer.android.com/reference/java/lang/annotation/ElementType.html#TYPE_USE) @https://developer.android.com/reference/kotlin/androidx/annotation/IntDef(value = ) annotation https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult` Possible outcomes of the evaluation. |

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_APP_OVERRIDE() = 4` Decoder reuse is disabled by overriding behavior in application code. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_AUDIO_BYPASS_POSSIBLE() = 32768` The audio bypass mode is possible. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED() = 4096` The audio channel count is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_AUDIO_ENCODING_CHANGED() = 16384` The audio encoding is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED() = 8192` The audio sample rate is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_DRM_SESSION_CHANGED() = 128` The DRM session is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_INITIALIZATION_DATA_CHANGED() = 32` The format initialization data is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED() = 64` The new format may exceed the decoder's configured maximum sample size, in bytes. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_MIME_TYPE_CHANGED() = 8` The sample MIME type is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_OPERATING_RATE_CHANGED() = 16` The codec's operating rate is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_REUSE_NOT_IMPLEMENTED() = 1` Decoder reuse is not implemented. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED() = 2048` The video `https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo` is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_VIDEO_FRAME_RATE_CHANGED() = 65536` The video frame rate is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED() = 256` The new format may exceed the decoder's configured maximum resolution. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_VIDEO_RESOLUTION_CHANGED() = 512` The video resolution is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_VIDEO_ROTATION_CHANGED() = 1024` The video rotation is changing. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DISCARD_REASON_WORKAROUND() = 2` Decoder reuse is disabled by a workaround. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#REUSE_RESULT_NO() = 0` The decoder cannot be reused. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#REUSE_RESULT_YES_WITHOUT_RECONFIGURATION() = 3` The decoder can be kept. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#REUSE_RESULT_YES_WITH_FLUSH() = 1` The decoder can be reused, but must be flushed. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#REUSE_RESULT_YES_WITH_RECONFIGURATION() = 2` The decoder can be reused. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#DecoderReuseEvaluation(java.lang.String,androidx.media3.common.Format,androidx.media3.common.Format,int,int)( decoderName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, oldFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, newFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult result: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, @https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons discardReasons: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#hashCode()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#decoderName()` The name of the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#discardReasons()` `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons` why the decoder cannot be reused. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#newFormat()` The new `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` being evaluated. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#oldFormat()` The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` for which the decoder was previously configured. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation#result()` The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult` of the evaluation. |

## Constants

### DISCARD_REASON_APP_OVERRIDE

```
const val DISCARD_REASON_APP_OVERRIDE = 4: Int
```

Decoder reuse is disabled by overriding behavior in application code.

### DISCARD_REASON_AUDIO_BYPASS_POSSIBLE

```
const val DISCARD_REASON_AUDIO_BYPASS_POSSIBLE = 32768: Int
```

The audio bypass mode is possible.

### DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED

```
const val DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED = 4096: Int
```

The audio channel count is changing.

### DISCARD_REASON_AUDIO_ENCODING_CHANGED

```
const val DISCARD_REASON_AUDIO_ENCODING_CHANGED = 16384: Int
```

The audio encoding is changing.

### DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED

```
const val DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED = 8192: Int
```

The audio sample rate is changing.

### DISCARD_REASON_DRM_SESSION_CHANGED

```
const val DISCARD_REASON_DRM_SESSION_CHANGED = 128: Int
```

The DRM session is changing.

### DISCARD_REASON_INITIALIZATION_DATA_CHANGED

```
const val DISCARD_REASON_INITIALIZATION_DATA_CHANGED = 32: Int
```

The format initialization data is changing.

### DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED

```
const val DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED = 64: Int
```

The new format may exceed the decoder's configured maximum sample size, in bytes.

### DISCARD_REASON_MIME_TYPE_CHANGED

```
const val DISCARD_REASON_MIME_TYPE_CHANGED = 8: Int
```

The sample MIME type is changing.

### DISCARD_REASON_OPERATING_RATE_CHANGED

```
const val DISCARD_REASON_OPERATING_RATE_CHANGED = 16: Int
```

The codec's operating rate is changing.

### DISCARD_REASON_REUSE_NOT_IMPLEMENTED

```
const val DISCARD_REASON_REUSE_NOT_IMPLEMENTED = 1: Int
```

Decoder reuse is not implemented.

### DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED

```
const val DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED = 2048: Int
```

The video `https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo` is changing.

### DISCARD_REASON_VIDEO_FRAME_RATE_CHANGED

```
const val DISCARD_REASON_VIDEO_FRAME_RATE_CHANGED = 65536: Int
```

The video frame rate is changing.

### DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED

```
const val DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED = 256: Int
```

The new format may exceed the decoder's configured maximum resolution.

### DISCARD_REASON_VIDEO_RESOLUTION_CHANGED

```
const val DISCARD_REASON_VIDEO_RESOLUTION_CHANGED = 512: Int
```

The video resolution is changing.

### DISCARD_REASON_VIDEO_ROTATION_CHANGED

```
const val DISCARD_REASON_VIDEO_ROTATION_CHANGED = 1024: Int
```

The video rotation is changing.

### DISCARD_REASON_WORKAROUND

```
const val DISCARD_REASON_WORKAROUND = 2: Int
```

Decoder reuse is disabled by a workaround.

### REUSE_RESULT_NO

```
const val REUSE_RESULT_NO = 0: Int
```

The decoder cannot be reused.

### REUSE_RESULT_YES_WITHOUT_RECONFIGURATION

```
const val REUSE_RESULT_YES_WITHOUT_RECONFIGURATION = 3: Int
```

The decoder can be kept. It does not need to be flushed and no reconfiguration is required.

### REUSE_RESULT_YES_WITH_FLUSH

```
const val REUSE_RESULT_YES_WITH_FLUSH = 1: Int
```

The decoder can be reused, but must be flushed.

### REUSE_RESULT_YES_WITH_RECONFIGURATION

```
const val REUSE_RESULT_YES_WITH_RECONFIGURATION = 2: Int
```

The decoder can be reused. It does not need to be flushed, but must be reconfigured by prefixing the next input buffer with the new format's configuration data.

## Public constructors

### DecoderReuseEvaluation

```
DecoderReuseEvaluation(
    decoderName: String!,
    oldFormat: Format!,
    newFormat: Format!,
    @DecoderReuseEvaluation.DecoderReuseResult result: Int,
    @DecoderReuseEvaluation.DecoderDiscardReasons discardReasons: Int
)
```

| Parameters |
|---|---|
| `decoderName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the decoder. |
| `oldFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` for which the decoder was previously configured. |
| `newFormat: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The new `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` being evaluated. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult result: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult` of the evaluation. |
| `@https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons discardReasons: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | One or more `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons` why the decoder cannot be reused, or `0` if reuse is possible. |

## Public functions

### equals

```
fun equals(obj: Any?): Boolean
```

### hashCode

```
fun hashCode(): Int
```

## Public properties

### decoderName

```
val decoderName: String!
```

The name of the decoder.

### discardReasons

```
@DecoderReuseEvaluation.DecoderDiscardReasons
val discardReasons: Int
```

`https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons` why the decoder cannot be reused. Always `0` if reuse is possible. May also be `0` if reuse is not possible for an unspecified reason.

### newFormat

```
val newFormat: Format!
```

The new `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` being evaluated.

### oldFormat

```
val oldFormat: Format!
```

The `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` for which the decoder was previously configured.

### result

```
@DecoderReuseEvaluation.DecoderReuseResult
val result: Int
```

The `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult` of the evaluation.