# MediaCodecRenderer.DecoderInitializationException

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

*** ** * ** ***


```
public class MediaCodecRenderer.DecoderInitializationException extends Exception
```

<br />

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||||
| ↳ | [kotlin.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.DecoderInitializationException](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException) |

*** ** * ** ***

Thrown when a failure occurs instantiating a decoder.

## Summary

| ### Public fields |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#codecInfo()` The `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo` of the decoder that failed to initialize. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#diagnosticInfo()` An optional developer-readable diagnostic information string. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#fallbackDecoderInitializationException()` If the decoder failed to initialize and another decoder being used as a fallback also failed to initialize, the `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException` for the fallback decoder. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#mimeType()` The MIME type for which a decoder was being initialized. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#secureDecoderRequired()` Whether it was required that the decoder support a secure output path. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#DecoderInitializationException(androidx.media3.common.Format,java.lang.Throwable,boolean,int)( https://developer.android.com/reference/androidx/media3/common/Format format, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause, boolean secureDecoderRequired, int errorCode )` |
| `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException#DecoderInitializationException(androidx.media3.common.Format,java.lang.Throwable,boolean,androidx.media3.exoplayer.mediacodec.MediaCodecInfo)( https://developer.android.com/reference/androidx/media3/common/Format format, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Throwable.html cause, boolean secureDecoderRequired, https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo mediaCodecInfo )` |

### Inherited methods

From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) `synchronized final void` `https://developer.android.com/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html exception)` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#fillInStackTrace()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#getCause()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getLocalizedMessage()()` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#getMessage()()` `StackTraceElement[]` `https://developer.android.com/reference/java/lang/Throwable.html#getStackTrace()()` `synchronized final Throwable[]` `https://developer.android.com/reference/java/lang/Throwable.html#getSuppressed()()` `synchronized https://developer.android.com/reference/java/lang/Throwable.html` `https://developer.android.com/reference/java/lang/Throwable.html#initCause(java.lang.Throwable)(https://developer.android.com/reference/java/lang/Throwable.html cause)` `void` `https://developer.android.com/reference/java/lang/Throwable.html#printStackTrace()()` `void` `https://developer.android.com/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[])(StackTraceElement[] stackTrace)` `https://developer.android.com/reference/java/lang/String.html` `https://developer.android.com/reference/java/lang/Throwable.html#toString()()`

## Public fields

### codecInfo

```
public final @Nullable MediaCodecInfo codecInfo
```

The `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo` of the decoder that failed to initialize. Null if no suitable decoder was found.

### diagnosticInfo

```
public final @Nullable String diagnosticInfo
```

An optional developer-readable diagnostic information string. May be null.

### fallbackDecoderInitializationException

```
public final @Nullable MediaCodecRenderer.DecoderInitializationException fallbackDecoderInitializationException
```

If the decoder failed to initialize and another decoder being used as a fallback also failed to initialize, the `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecRenderer.DecoderInitializationException` for the fallback decoder. Null if there was no fallback decoder or no suitable decoders were found.

### mimeType

```
public final @Nullable String mimeType
```

The MIME type for which a decoder was being initialized.

### secureDecoderRequired

```
public final boolean secureDecoderRequired
```

Whether it was required that the decoder support a secure output path.

## Public constructors

### DecoderInitializationException

```
public DecoderInitializationException(
    Format format,
    @Nullable Throwable cause,
    boolean secureDecoderRequired,
    int errorCode
)
```

### DecoderInitializationException

```
public DecoderInitializationException(
    Format format,
    @Nullable Throwable cause,
    boolean secureDecoderRequired,
    MediaCodecInfo mediaCodecInfo
)
```