# MediaCodecAdapter.Configuration

# MediaCodecAdapter.Configuration

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

*** ** * ** ***

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

<br />

```
class MediaCodecAdapter.Configuration
```

<br />

*** ** * ** ***

Configuration parameters for a[MediaCodecAdapter](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter).

## Summary

|                                                                          ### Public functions                                                                           |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `java-static `[MediaCodecAdapter.Configuration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration)`!` | [createForAudioDecoding](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#createForAudioDecoding(androidx.media3.exoplayer.mediacodec.MediaCodecInfo,android.media.MediaFormat,androidx.media3.common.Format,android.media.MediaCrypto,androidx.media3.exoplayer.mediacodec.LoudnessCodecController))`(` ` codecInfo: `[MediaCodecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecInfo)`!,` ` mediaFormat: `[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)`!,` ` format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!,` ` crypto: `[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)`?,` ` loudnessCodecController: `[LoudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/LoudnessCodecController)`?` `)` Creates a configuration for audio decoding. |
| `java-static `[MediaCodecAdapter.Configuration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration)`!` | [createForVideoDecoding](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#createForVideoDecoding(androidx.media3.exoplayer.mediacodec.MediaCodecInfo,android.media.MediaFormat,androidx.media3.common.Format,android.view.Surface,android.media.MediaCrypto))`(` ` codecInfo: `[MediaCodecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecInfo)`!,` ` mediaFormat: `[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)`!,` ` format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!,` ` surface: `[Surface](https://developer.android.com/reference/android/view/Surface.html)`?,` ` crypto: `[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)`?` `)` Creates a configuration for video decoding.                                                                                                                   |

|                                                           ### Public properties                                                           |
|-------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [MediaCodecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecInfo)`!`                   | [codecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#codecInfo()) Information about the[MediaCodec](https://developer.android.com/reference/android/media/MediaCodec.html)being configured.                                                              |
| [MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)`?`                                                  | [crypto](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#crypto()) For DRM protected playbacks, a[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)to use for decryption.                                                    |
| [Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                                                 | [format](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#format()) The[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)for which the codec is being configured.                                                            |
| [LoudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/LoudnessCodecController)`?` | [loudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#loudnessCodecController()) The[LoudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/LoudnessCodecController)for audio codecs. |
| [MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)`!`                                                  | [mediaFormat](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#mediaFormat()) The[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)for which the codec is being configured.                                                   |
| [Surface](https://developer.android.com/reference/android/view/Surface.html)`?`                                                           | [surface](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#surface()) For video decoding, the output where the object will render the decoded frames.                                                                                                            |

## Public functions

### createForAudioDecoding

```
java-static fun createForAudioDecoding(
    codecInfo: MediaCodecInfo!,
    mediaFormat: MediaFormat!,
    format: Format!,
    crypto: MediaCrypto?,
    loudnessCodecController: LoudnessCodecController?
): MediaCodecAdapter.Configuration!
```

Creates a configuration for audio decoding.  

|                                                                              Parameters                                                                              |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `codecInfo: `[MediaCodecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecInfo)`!`                                 | See[codecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#codecInfo()).                             |
| `mediaFormat: `[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)`!`                                                              | See[mediaFormat](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#mediaFormat()).                         |
| `format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                                                                  | See[format](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#format()).                                   |
| `crypto: `[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)`?`                                                                   | See[crypto](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#crypto()).                                   |
| `loudnessCodecController: `[LoudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/LoudnessCodecController)`?` | See[loudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#loudnessCodecController()). |

|                                                                          Returns                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| [MediaCodecAdapter.Configuration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration)`!` | The created instance. |

### createForVideoDecoding

```
java-static fun createForVideoDecoding(
    codecInfo: MediaCodecInfo!,
    mediaFormat: MediaFormat!,
    format: Format!,
    surface: Surface?,
    crypto: MediaCrypto?
): MediaCodecAdapter.Configuration!
```

Creates a configuration for video decoding.  

|                                                              Parameters                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| `codecInfo: `[MediaCodecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecInfo)`!` | See[codecInfo](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#codecInfo()).     |
| `mediaFormat: `[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)`!`                              | See[mediaFormat](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#mediaFormat()). |
| `format: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                                  | See[format](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#format()).           |
| `surface: `[Surface](https://developer.android.com/reference/android/view/Surface.html)`?`                                           | See[surface](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#surface()).         |
| `crypto: `[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)`?`                                   | See[crypto](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration#crypto()).           |

|                                                                          Returns                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| [MediaCodecAdapter.Configuration](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration)`!` | The created instance. |

## Public properties

### codecInfo

```
val codecInfo: MediaCodecInfo!
```

Information about the[MediaCodec](https://developer.android.com/reference/android/media/MediaCodec.html)being configured.  

### crypto

```
val crypto: MediaCrypto?
```

For DRM protected playbacks, a[MediaCrypto](https://developer.android.com/reference/android/media/MediaCrypto.html)to use for decryption.  

### format

```
val format: Format!
```

The[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)for which the codec is being configured.  

### loudnessCodecController

```
val loudnessCodecController: LoudnessCodecController?
```

The[LoudnessCodecController](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/LoudnessCodecController)for audio codecs.  

### mediaFormat

```
val mediaFormat: MediaFormat!
```

The[MediaFormat](https://developer.android.com/reference/android/media/MediaFormat.html)for which the codec is being configured.  

### surface

```
val surface: Surface?
```

For video decoding, the output where the object will render the decoded frames. This must be null if the codec is not a video decoder, or if it is configured for[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html)output.