# 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
public final 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/androidx/annotation/IntDef(flag = true, value = ) public annotation https://developer.android.com/reference/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/androidx/annotation/IntDef(value = ) public annotation https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult` Possible outcomes of the evaluation. |

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

| ### Public fields |
|---|---|
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#decoderName()` The name of the decoder. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#discardReasons()` `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderDiscardReasons` why the decoder cannot be reused. |
| `final https://developer.android.com/reference/androidx/media3/common/Format` | `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#newFormat()` The new `https://developer.android.com/reference/androidx/media3/common/Format` being evaluated. |
| `final https://developer.android.com/reference/androidx/media3/common/Format` | `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#oldFormat()` The `https://developer.android.com/reference/androidx/media3/common/Format` for which the decoder was previously configured. |
| `final int` | `@https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#result()` The `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation.DecoderReuseResult` of the evaluation. |

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#equals(java.lang.Object)(@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Object.html obj)` |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation#hashCode()()` |

## Constants

### DISCARD_REASON_APP_OVERRIDE

```
public static final int DISCARD_REASON_APP_OVERRIDE = 4
```

Decoder reuse is disabled by overriding behavior in application code.

### DISCARD_REASON_AUDIO_BYPASS_POSSIBLE

```
public static final int DISCARD_REASON_AUDIO_BYPASS_POSSIBLE = 32768
```

The audio bypass mode is possible.

### DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED

```
public static final int DISCARD_REASON_AUDIO_CHANNEL_COUNT_CHANGED = 4096
```

The audio channel count is changing.

### DISCARD_REASON_AUDIO_ENCODING_CHANGED

```
public static final int DISCARD_REASON_AUDIO_ENCODING_CHANGED = 16384
```

The audio encoding is changing.

### DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED

```
public static final int DISCARD_REASON_AUDIO_SAMPLE_RATE_CHANGED = 8192
```

The audio sample rate is changing.

### DISCARD_REASON_DRM_SESSION_CHANGED

```
public static final int DISCARD_REASON_DRM_SESSION_CHANGED = 128
```

The DRM session is changing.

### DISCARD_REASON_INITIALIZATION_DATA_CHANGED

```
public static final int DISCARD_REASON_INITIALIZATION_DATA_CHANGED = 32
```

The format initialization data is changing.

### DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED

```
public static final int DISCARD_REASON_MAX_INPUT_SIZE_EXCEEDED = 64
```

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

### DISCARD_REASON_MIME_TYPE_CHANGED

```
public static final int DISCARD_REASON_MIME_TYPE_CHANGED = 8
```

The sample MIME type is changing.

### DISCARD_REASON_OPERATING_RATE_CHANGED

```
public static final int DISCARD_REASON_OPERATING_RATE_CHANGED = 16
```

The codec's operating rate is changing.

### DISCARD_REASON_REUSE_NOT_IMPLEMENTED

```
public static final int DISCARD_REASON_REUSE_NOT_IMPLEMENTED = 1
```

Decoder reuse is not implemented.

### DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED

```
public static final int DISCARD_REASON_VIDEO_COLOR_INFO_CHANGED = 2048
```

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

### DISCARD_REASON_VIDEO_FRAME_RATE_CHANGED

```
public static final int DISCARD_REASON_VIDEO_FRAME_RATE_CHANGED = 65536
```

The video frame rate is changing.

### DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED

```
public static final int DISCARD_REASON_VIDEO_MAX_RESOLUTION_EXCEEDED = 256
```

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

### DISCARD_REASON_VIDEO_RESOLUTION_CHANGED

```
public static final int DISCARD_REASON_VIDEO_RESOLUTION_CHANGED = 512
```

The video resolution is changing.

### DISCARD_REASON_VIDEO_ROTATION_CHANGED

```
public static final int DISCARD_REASON_VIDEO_ROTATION_CHANGED = 1024
```

The video rotation is changing.

### DISCARD_REASON_WORKAROUND

```
public static final int DISCARD_REASON_WORKAROUND = 2
```

Decoder reuse is disabled by a workaround.

### REUSE_RESULT_NO

```
public static final int REUSE_RESULT_NO = 0
```

The decoder cannot be reused.

### REUSE_RESULT_YES_WITHOUT_RECONFIGURATION

```
public static final int REUSE_RESULT_YES_WITHOUT_RECONFIGURATION = 3
```

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

### REUSE_RESULT_YES_WITH_FLUSH

```
public static final int REUSE_RESULT_YES_WITH_FLUSH = 1
```

The decoder can be reused, but must be flushed.

### REUSE_RESULT_YES_WITH_RECONFIGURATION

```
public static final int REUSE_RESULT_YES_WITH_RECONFIGURATION = 2
```

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 fields

### decoderName

```
public final String decoderName
```

The name of the decoder.

### discardReasons

```
@DecoderReuseEvaluation.DecoderDiscardReasons
public final int discardReasons
```

`https://developer.android.com/reference/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

```
public final Format newFormat
```

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

### oldFormat

```
public final Format oldFormat
```

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

### result

```
@DecoderReuseEvaluation.DecoderReuseResult
public final int result
```

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

## Public constructors

### DecoderReuseEvaluation

```
public DecoderReuseEvaluation(
    String decoderName,
    Format oldFormat,
    Format newFormat,
    @DecoderReuseEvaluation.DecoderReuseResult int result,
    @DecoderReuseEvaluation.DecoderDiscardReasons int discardReasons
)
```

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

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### hashCode

```
public int hashCode()
```