# EncoderUtil

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

*** ** * ** ***


```
@UnstableApi
class EncoderUtil
```

<br />

*** ** * ** ***

Utility methods for `https://developer.android.com/reference/android/media/MediaCodec.html` encoders.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#LEVEL_UNSET() = -1` A value to indicate the encoding level is not set. |

| ### Public functions |
|---|---|
| `synchronized java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/VisibleForTesting https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#clearCachedEncoders()()` Clears the cached list of encoders. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#findHighestSupportedEncodingLevel(android.media.MediaCodecInfo,java.lang.String,int)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, profile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Finds the highest supported encoding level given a profile. |
| `java-static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#findSupportedEncodingProfiles(android.media.MediaCodecInfo,java.lang.String)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html! )` Returns a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html` of supported `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html` and `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getClosestSupportedSampleRate(android.media.MediaCodecInfo,java.lang.String,int)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, requestedSampleRate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns the sample rate supported by the provided `https://developer.android.com/reference/android/media/MediaCodecInfo.html` that is closest to the provided sample rate for a given `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `java-static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getCodecProfilesForHdrFormat(java.lang.String,int)( mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, @https://developer.android.com/reference/kotlin/androidx/media3/common/C.ColorTransfer colorTransfer: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns the `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html#profile` constants that can be used to encode the given HDR format, if supported by the device (this method does not check device capabilities). |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getMaxSupportedInstances(android.media.MediaCodecInfo,java.lang.String)(encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns the number of max number of the supported concurrent codec instances. |
| `java-static https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedBitrateRange(android.media.MediaCodecInfo,java.lang.String)(encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns the range of supported bitrates for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `java-static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedColorFormats(android.media.MediaCodecInfo,java.lang.String)(encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html` of supported `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#colorFormats` for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html` and `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `synchronized java-static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/android/media/MediaCodecInfo.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedEncoders(java.lang.String)(mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Returns a list of `https://developer.android.com/reference/android/media/MediaCodecInfo.html` that support the given `mimeType`, or an empty list if there is none. |
| `java-static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/android/media/MediaCodecInfo.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedEncodersForHdrEditing(java.lang.String,androidx.media3.common.ColorInfo)(mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, colorInfo: https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo?)` Returns a list of `https://developer.android.com/reference/android/media/MediaCodecInfo.html` that support HDR editing for the given `mimeType` and `ColorInfo`, or an empty list if the format is unknown or not supported for HDR encoding. |
| `java-static https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedHeights(android.media.MediaCodecInfo,java.lang.String,int)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns a `https://developer.android.com/reference/android/util/Range.html` of supported heights for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html`, `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes` and `width`. |
| `synchronized java-static https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedMimeTypes()()` Returns a list of `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes` that can be encoded. |
| `java-static https://developer.android.com/reference/android/util/Size.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedResolution(android.media.MediaCodecInfo,java.lang.String,int,int)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Finds an `https://developer.android.com/reference/android/media/MediaCodecInfo.html`'s supported resolution from a given resolution. |
| `java-static https://developer.android.com/reference/android/util/Pair.html<https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!, https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedResolutionRanges(android.media.MediaCodecInfo,java.lang.String)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html! )` Returns a `https://developer.android.com/reference/android/util/Pair.html` of supported width and height `https://developer.android.com/reference/android/util/Range.html` for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html` and `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#isBitrateModeSupported(android.media.MediaCodecInfo,java.lang.String,int)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, bitrateMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns whether the bitrate mode is supported by the encoder. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#isFeatureSupported(android.media.MediaCodecInfo,java.lang.String,java.lang.String)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, featureName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html! )` Returns whether a given feature is supported. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#isHardwareAccelerated(android.media.MediaCodecInfo,java.lang.String)(encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Checks if a `https://developer.android.com/reference/android/media/MediaCodecInfo.html` is hardware-accelerated. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 33) https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#isHdrEditingSupported(android.media.MediaCodecInfo,java.lang.String,androidx.media3.common.ColorInfo)( mediaCodecInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, colorInfo: https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo! )` Returns whether HDR editing with the given `https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo` is supported by the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#isSizeSupported(android.media.MediaCodecInfo,java.lang.String,int,int)( encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!, mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns whether the `https://developer.android.com/reference/android/media/MediaCodecInfo.html` supports the given resolution for a specific `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `java-static https://developer.android.com/reference/android/util/Pair.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html!>!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#parseTemporalLayeringSchema(java.lang.String)(schema: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` Parses a `https://developer.android.com/reference/android/media/MediaFormat.html#KEY_TEMPORAL_LAYERING` schema string into a `https://developer.android.com/reference/android/util/Pair.html` of the `https://developer.android.com/reference/kotlin/androidx/media3/transformer/VideoEncoderSettings#numNonBidirectionalTemporalLayers()` and the `https://developer.android.com/reference/kotlin/androidx/media3/transformer/VideoEncoderSettings#numBidirectionalTemporalLayers()`. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#toTemporalLayeringSchema(int,int)( numNonBidirectionalLayers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, numBidirectionalLayers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns the `https://developer.android.com/reference/android/media/MediaFormat.html#KEY_TEMPORAL_LAYERING` schema string for the given temporal layer counts. |

## Constants

### LEVEL_UNSET

```
const val LEVEL_UNSET = -1: Int
```

A value to indicate the encoding level is not set.

## Public functions

### clearCachedEncoders

```
@VisibleForTesting
synchronized java-static fun clearCachedEncoders(): Unit
```

Clears the cached list of encoders.

### findHighestSupportedEncodingLevel

```
java-static fun findHighestSupportedEncodingLevel(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    profile: Int
): Int
```

Finds the highest supported encoding level given a profile.

| Parameters |
|---|---|
| `encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!` | The `https://developer.android.com/reference/android/media/MediaCodecInfo.html`. |
| `mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `profile: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The encoding profile. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The highest supported encoding level, as documented in `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html`, or `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#LEVEL_UNSET()` if the profile is not supported. |

### findSupportedEncodingProfiles

```
java-static fun findSupportedEncodingProfiles(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!
): ImmutableSet<Int!>!
```

Returns a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableSet.html` of supported `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html` for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html` and `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`.

### getClosestSupportedSampleRate

```
java-static fun getClosestSupportedSampleRate(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    requestedSampleRate: Int
): Int
```

Returns the sample rate supported by the provided `https://developer.android.com/reference/android/media/MediaCodecInfo.html` that is closest to the provided sample rate for a given `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`.

### getCodecProfilesForHdrFormat

```
java-static fun getCodecProfilesForHdrFormat(
    mimeType: String!,
    @C.ColorTransfer colorTransfer: Int
): ImmutableList<Int!>!
```

Returns the `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel.html#profile` constants that can be used to encode the given HDR format, if supported by the device (this method does not check device capabilities). If multiple profiles are returned, they are ordered by expected level of compatibility, with the most widely compatible profile first.

### getMaxSupportedInstances

```
java-static fun getMaxSupportedInstances(encoderInfo: MediaCodecInfo!, mimeType: String!): Int
```

Returns the number of max number of the supported concurrent codec instances.

### getSupportedBitrateRange

```
java-static fun getSupportedBitrateRange(encoderInfo: MediaCodecInfo!, mimeType: String!): Range<Int!>!
```

Returns the range of supported bitrates for the given `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`.

### getSupportedColorFormats

```
java-static fun getSupportedColorFormats(encoderInfo: MediaCodecInfo!, mimeType: String!): ImmutableList<Int!>!
```

Returns a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html` of supported `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#colorFormats` for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html` and `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`.

### getSupportedEncoders

```
synchronized java-static fun getSupportedEncoders(mimeType: String!): ImmutableList<MediaCodecInfo!>!
```

Returns a list of `https://developer.android.com/reference/android/media/MediaCodecInfo.html` that support the given `mimeType`, or an empty list if there is none.

### getSupportedEncodersForHdrEditing

```
java-static fun getSupportedEncodersForHdrEditing(mimeType: String!, colorInfo: ColorInfo?): ImmutableList<MediaCodecInfo!>!
```

Returns a list of `https://developer.android.com/reference/android/media/MediaCodecInfo.html` that support HDR editing for the given `mimeType` and `ColorInfo`, or an empty list if the format is unknown or not supported for HDR encoding.

### getSupportedHeights

```
java-static fun getSupportedHeights(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    width: Int
): Range<Int!>!
```

Returns a `https://developer.android.com/reference/android/util/Range.html` of supported heights for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html`, `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes` and `width`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | When the width is not in the range of `https://developer.android.com/reference/kotlin/androidx/media3/transformer/EncoderUtil#getSupportedResolutionRanges(android.media.MediaCodecInfo,java.lang.String)`. |

### getSupportedMimeTypes

```
synchronized java-static fun getSupportedMimeTypes(): ImmutableSet<String!>!
```

Returns a list of `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes` that can be encoded.

### getSupportedResolution

```
java-static fun getSupportedResolution(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    width: Int,
    height: Int
): Size?
```

Finds an `https://developer.android.com/reference/android/media/MediaCodecInfo.html`'s supported resolution from a given resolution.

The input resolution is returned, if it (after aligning to the encoder's requirement) is supported by the `https://developer.android.com/reference/android/media/MediaCodecInfo.html`.

The resolution will be adjusted to be within the `https://developer.android.com/reference/android/media/MediaCodecInfo.html`'s range of supported resolutions, and will be aligned to the `https://developer.android.com/reference/android/media/MediaCodecInfo.html`'s alignment requirement. The adjustment process takes into account the original aspect ratio. But the fixed resolution may not preserve the original aspect ratio, depending on the encoder's required size alignment.

| Parameters |
|---|---|
| `encoderInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!` | The `https://developer.android.com/reference/android/media/MediaCodecInfo.html` of the encoder. |
| `mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The output `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`. |
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The original width. |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The original height. |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/util/Size.html?` | A `https://developer.android.com/reference/android/util/Size.html`, or `null` if unable to find a fallback. |

### getSupportedResolutionRanges

```
java-static fun getSupportedResolutionRanges(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!
): Pair<Range<Int!>!, Range<Int!>!>!
```

Returns a `https://developer.android.com/reference/android/util/Pair.html` of supported width and height `https://developer.android.com/reference/android/util/Range.html` for the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html` and `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`.

### isBitrateModeSupported

```
java-static fun isBitrateModeSupported(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    bitrateMode: Int
): Boolean
```

Returns whether the bitrate mode is supported by the encoder.

### isFeatureSupported

```
java-static fun isFeatureSupported(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    featureName: String!
): Boolean
```

Returns whether a given feature is supported.

### isHardwareAccelerated

```
java-static fun isHardwareAccelerated(encoderInfo: MediaCodecInfo!, mimeType: String!): Boolean
```

Checks if a `https://developer.android.com/reference/android/media/MediaCodecInfo.html` is hardware-accelerated.

### isHdrEditingSupported

```
@RequiresApi(value = 33)
java-static fun isHdrEditingSupported(
    mediaCodecInfo: MediaCodecInfo!,
    mimeType: String!,
    colorInfo: ColorInfo!
): Boolean
```

Returns whether HDR editing with the given `https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo` is supported by the given `https://developer.android.com/reference/android/media/MediaCodecInfo.html`.

| Parameters |
|---|---|
| `mediaCodecInfo: https://developer.android.com/reference/android/media/MediaCodecInfo.html!` | The encoder. |
| `mimeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The MIME type of the video stream. |
| `colorInfo: https://developer.android.com/reference/kotlin/androidx/media3/common/ColorInfo!` | The color info. |

### isSizeSupported

```
java-static fun isSizeSupported(
    encoderInfo: MediaCodecInfo!,
    mimeType: String!,
    width: Int,
    height: Int
): Boolean
```

Returns whether the `https://developer.android.com/reference/android/media/MediaCodecInfo.html` supports the given resolution for a specific `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes`.

### parseTemporalLayeringSchema

```
java-static fun parseTemporalLayeringSchema(schema: String!): Pair<Int!, Int!>!
```

Parses a `https://developer.android.com/reference/android/media/MediaFormat.html#KEY_TEMPORAL_LAYERING` schema string into a `https://developer.android.com/reference/android/util/Pair.html` of the `https://developer.android.com/reference/kotlin/androidx/media3/transformer/VideoEncoderSettings#numNonBidirectionalTemporalLayers()` and the `https://developer.android.com/reference/kotlin/androidx/media3/transformer/VideoEncoderSettings#numBidirectionalTemporalLayers()`.

This method only supports `"none"`, which is parsed as zero layers, and the `
"android.generic.N[+M]"` schemas defined by `https://developer.android.com/reference/android/media/MediaFormat.html#KEY_TEMPORAL_LAYERING`.

| Parameters |
|---|---|
| `schema: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The temporal layering schema string. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException.html` | If the schema is a `"webrtc.*"` schema. |
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If the schema is malformed or a layer count does not fit in an int. |

### toTemporalLayeringSchema

```
java-static fun toTemporalLayeringSchema(
    numNonBidirectionalLayers: Int,
    numBidirectionalLayers: Int
): String!
```

Returns the `https://developer.android.com/reference/android/media/MediaFormat.html#KEY_TEMPORAL_LAYERING` schema string for the given temporal layer counts.

Returns `"none"` if `numNonBidirectionalLayers` is zero, `
"android.generic.N"` if `numBidirectionalLayers` is zero, and `
"android.generic.N+M"` otherwise.

| Parameters |
|---|---|
| `numNonBidirectionalLayers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of non-bidirectional temporal layers. Must be non-negative. |
| `numBidirectionalLayers: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The number of bidirectional temporal layers. Must be non-negative if `numNonBidirectionalLayers` is positive, and zero or `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#NO_VALUE()` if it is zero. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `numNonBidirectionalLayers` is negative, if it is positive and `numBidirectionalLayers` is negative, or if it is zero and ` numBidirectionalLayers` is neither zero nor `https://developer.android.com/reference/kotlin/androidx/media3/common/Format#NO_VALUE()`. |