# CodecSpecificDataUtil.MediaCodecProfileAndLevel

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

*** ** * ** ***


```
public final class CodecSpecificDataUtil.MediaCodecProfileAndLevel
```

<br />

*** ** * ** ***

A tuple of profile and level constants for `https://developer.android.com/reference/android/media/MediaCodec.html`.

This is similar to `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`, except it:

- Is immutable.
- Can be used to represent a profile and level that may be valid but isn't representable by `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` constants.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#UNSUPPORTABLE()` An instance that represents a profile and level combination not representable with `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` constants. |

| ### Public fields |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#isSupportableByMediaCodec()` |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#level()` |
| `final int` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#profile()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#MediaCodecProfileAndLevel(int,int)(int profile, int level)` Constructs an instance with values from `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`. |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#getLevel()()` Returns the level value, which will be a constant from `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`. |
| `int` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#getProfile()()` Returns the profile value, which will be a constant from `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#isSupportableByMediaCodec()()` Returns whether the profile and level represented by this instance can be represented by `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` constants. |

## Constants

### UNSUPPORTABLE

```
public static final CodecSpecificDataUtil.MediaCodecProfileAndLevel UNSUPPORTABLE
```

An instance that represents a profile and level combination not representable with `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` constants.

## Public fields

### isSupportableByMediaCodec

```
public final boolean isSupportableByMediaCodec
```

### level

```
public final int level
```

### profile

```
public final int profile
```

## Public constructors

### MediaCodecProfileAndLevel

```
public MediaCodecProfileAndLevel(int profile, int level)
```

Constructs an instance with values from `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`.

## Public methods

### getLevel

```
public int getLevel()
```

Returns the level value, which will be a constant from `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`.

Callers must check `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#isSupportableByMediaCodec()` returns `true` before calling this method.

### getProfile

```
public int getProfile()
```

Returns the profile value, which will be a constant from `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`.

Callers must check `https://developer.android.com/reference/androidx/media3/common/util/CodecSpecificDataUtil.MediaCodecProfileAndLevel#isSupportableByMediaCodec()` returns `true` before calling this method.

### isSupportableByMediaCodec

```
public boolean isSupportableByMediaCodec()
```

Returns whether the profile and level represented by this instance can be represented by `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` constants.

This is based on the set of constants available when this library was compiled. It is not related to the `https://developer.android.com/reference/android/os/Build.VERSION.html#SDK_INT` of the current device.