# MediaCodecInfo

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

*** ** * ** ***


```
@UnstableApi
public final class MediaCodecInfo
```

<br />

*** ** * ** ***

Information about a `https://developer.android.com/reference/android/media/MediaCodec.html` for a given MIME type.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#MAX_SUPPORTED_INSTANCES_UNKNOWN() = -1` The value returned by `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#getMaxSupportedInstances()` if the upper bound on the maximum number of supported instances is unknown. |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#TAG() = "MediaCodecInfo"` |

| ### Public fields |
|---|---|
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#adaptive()` Whether the decoder supports seamless resolution switches. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#capabilities()` The capabilities of the decoder, like the profiles/levels it supports, or `null` if not known. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#codecMimeType()` The MIME type that the codec uses for media of type `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#mimeType()`. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#detachedSurfaceSupported()` Whether the codec supports "detached" surface mode where it is able to decode without an attached surface. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#hardwareAccelerated()` Whether the codec is hardware accelerated. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#mimeType()` The MIME type handled by the codec. |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#name()` The name of the decoder. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#secure()` Whether the decoder is secure. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#softwareOnly()` Whether the codec is software only. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#tunneling()` Whether the decoder supports tunneling. |
| `final boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#vendor()` Whether the codec is from the vendor. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/Point.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#alignVideoSize(int,int)(int width, int height)` Returns the smallest video size greater than or equal to a specified size that also satisfies the `https://developer.android.com/reference/android/media/MediaCodec.html`'s width and height alignment requirements. |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/Point.html` | `@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.alignVideoSize(width, height)") [alignVideoSizeV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#alignVideoSizeV21(int,int))(int width, int height)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#alignVideoSize(int,int)` instead. <br /> |
| `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#canReuseCodec(androidx.media3.common.Format,androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format oldFormat, https://developer.android.com/reference/androidx/media3/common/Format newFormat)` Evaluates whether it's possible to reuse an instance of this decoder that's currently decoding `oldFormat` to decode `newFormat` instead. |
| `float` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#getMaxSupportedFrameRate(int,int)(int width, int height)` Returns the max video frame rate that this codec can support at the provided resolution, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET()` if this is not a video codec. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#getMaxSupportedInstances()()` Returns an upper bound on the maximum number of supported instances, or `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#MAX_SUPPORTED_INSTANCES_UNKNOWN()` if unknown. |
| `MediaCodecInfo.CodecProfileLevel[]` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#getProfileLevels()()` The profile levels supported by the decoder. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioChannelCountSupported(int)(int channelCount)` Whether the decoder supports audio with a given channel count. |
| `final boolean` | `@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.isAudioChannelCountSupported(channelCount)") [isAudioChannelCountSupportedV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioChannelCountSupportedV21(int))(int channelCount)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioChannelCountSupported(int)` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioSampleRateSupported(int)(int sampleRate)` Whether the decoder supports audio with a given sample rate. |
| `final boolean` | `@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.isAudioSampleRateSupported(sampleRate)") [isAudioSampleRateSupportedV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioSampleRateSupportedV21(int))(int sampleRate)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioSampleRateSupported(int)` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isFormatFunctionallySupported(android.content.Context,androidx.media3.common.Format)(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/common/Format format)` Returns whether the decoder may functionally support decoding the given `format`. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isFormatSupported(android.content.Context,androidx.media3.common.Format)(https://developer.android.com/reference/android/content/Context.html context, https://developer.android.com/reference/androidx/media3/common/Format format)` Returns whether the decoder may support decoding the given `format` both functionally and performantly. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isHdr10PlusOutOfBandMetadataSupported()()` Whether the codec handles HDR10+ out-of-band metadata. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isSeamlessAdaptationSupported(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format format)` Returns whether it may be possible to adapt an instance of this decoder to playing a different format when the codec is configured to play media in the specified `format`. |
| `boolean` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isVideoSizeAndRateSupported(int,int,double)(int width, int height, double frameRate)` Whether the decoder supports video with a given width, height and frame rate. |
| `final boolean` | `@https://checkerframework.org/api/com/google/errorprone/annotations/InlineMe.html(replacement = "this.isVideoSizeAndRateSupported(width, height, frameRate)") [isVideoSizeAndRateSupportedV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isVideoSizeAndRateSupportedV21(int,int,double))(int width, int height, double frameRate)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isVideoSizeAndRateSupported(int,int,double)` instead. <br /> |
| `static https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#newInstance(java.lang.String,java.lang.String,java.lang.String,android.media.MediaCodecInfo.CodecCapabilities,boolean,boolean,boolean)( https://developer.android.com/reference/java/lang/String.html name, https://developer.android.com/reference/java/lang/String.html mimeType, https://developer.android.com/reference/java/lang/String.html codecMimeType, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html capabilities, boolean hardwareAccelerated, boolean softwareOnly, boolean vendor )` Creates an instance. |
| `static https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo` | `[newInstance](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#newInstance(java.lang.String,java.lang.String,java.lang.String,android.media.MediaCodecInfo.CodecCapabilities,boolean,boolean,boolean,boolean,boolean))( https://developer.android.com/reference/java/lang/String.html name, https://developer.android.com/reference/java/lang/String.html mimeType, https://developer.android.com/reference/java/lang/String.html codecMimeType, @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html capabilities, boolean hardwareAccelerated, boolean softwareOnly, boolean vendor, boolean forceDisableAdaptive, boolean forceSecure )` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#newInstance(java.lang.String,java.lang.String,java.lang.String,android.media.MediaCodecInfo.CodecCapabilities,boolean,boolean,boolean)` instead. <br /> |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#toString()()` |

## Constants

### MAX_SUPPORTED_INSTANCES_UNKNOWN

```
public static final int MAX_SUPPORTED_INSTANCES_UNKNOWN = -1
```

The value returned by `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#getMaxSupportedInstances()` if the upper bound on the maximum number of supported instances is unknown.

### TAG

```
public static final String TAG = "MediaCodecInfo"
```

## Public fields

### adaptive

```
public final boolean adaptive
```

Whether the decoder supports seamless resolution switches.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#isFeatureSupported(java.lang.String)` |   |
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#FEATURE_AdaptivePlayback` |   |

### capabilities

```
public final @Nullable MediaCodecInfo.CodecCapabilities capabilities
```

The capabilities of the decoder, like the profiles/levels it supports, or `null` if not known.

### codecMimeType

```
public final String codecMimeType
```

The MIME type that the codec uses for media of type `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#mimeType()`. Equal to `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#mimeType()` unless the codec is known to use a non-standard MIME type alias.

### detachedSurfaceSupported

```
public final boolean detachedSurfaceSupported
```

Whether the codec supports "detached" surface mode where it is able to decode without an attached surface. Only relevant for video codecs.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#FEATURE_DetachedSurface` |   |

### hardwareAccelerated

```
public final boolean hardwareAccelerated
```

Whether the codec is hardware accelerated.

This could be an approximation as the exact information is only provided in API levels 29+.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.html#isHardwareAccelerated()` |   |

### mimeType

```
public final String mimeType
```

The MIME type handled by the codec.

### name

```
public final String name
```

The name of the decoder.

May be passed to `https://developer.android.com/reference/android/media/MediaCodec.html#createByCodecName(java.lang.String)` to create an instance of the decoder.

### secure

```
public final boolean secure
```

Whether the decoder is secure.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#isFeatureSupported(java.lang.String)` |   |
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#FEATURE_SecurePlayback` |   |

### softwareOnly

```
public final boolean softwareOnly
```

Whether the codec is software only.

This could be an approximation as the exact information is only provided in API levels 29+.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.html#isSoftwareOnly()` |   |

### tunneling

```
public final boolean tunneling
```

Whether the decoder supports tunneling.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#isFeatureSupported(java.lang.String)` |   |
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#FEATURE_TunneledPlayback` |   |

### vendor

```
public final boolean vendor
```

Whether the codec is from the vendor.

This could be an approximation as the exact information is only provided in API levels 29+.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.html#isVendor()` |   |

## Public methods

### alignVideoSize

```
public @Nullable Point alignVideoSize(int width, int height)
```

Returns the smallest video size greater than or equal to a specified size that also satisfies the `https://developer.android.com/reference/android/media/MediaCodec.html`'s width and height alignment requirements.

| Parameters |
|---|---|
| `int width` | Width in pixels. |
| `int height` | Height in pixels. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/graphics/Point.html` | The smallest video size greater than or equal to the specified size that also satisfies the `https://developer.android.com/reference/android/media/MediaCodec.html`'s width and height alignment requirements, or null if not a video codec. |

### alignVideoSizeV21

```
@InlineMe(replacement = "this.alignVideoSize(width, height)")
public final @Nullable Point [alignVideoSizeV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#alignVideoSizeV21(int,int))(int width, int height)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#alignVideoSize(int,int)` instead.

### canReuseCodec

```
public DecoderReuseEvaluation canReuseCodec(Format oldFormat, Format newFormat)
```

Evaluates whether it's possible to reuse an instance of this decoder that's currently decoding `oldFormat` to decode `newFormat` instead.

For adaptation to succeed, the codec must also be configured with maximum values that are compatible with the new format.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Format oldFormat` | The format being decoded. |
| `https://developer.android.com/reference/androidx/media3/common/Format newFormat` | The new format. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/DecoderReuseEvaluation` | The result of the evaluation. |

### getMaxSupportedFrameRate

```
public float getMaxSupportedFrameRate(int width, int height)
```

Returns the max video frame rate that this codec can support at the provided resolution, or `https://developer.android.com/reference/androidx/media3/common/C#RATE_UNSET()` if this is not a video codec.

### getMaxSupportedInstances

```
public int getMaxSupportedInstances()
```

Returns an upper bound on the maximum number of supported instances, or `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#MAX_SUPPORTED_INSTANCES_UNKNOWN()` if unknown. Applications should not expect to operate more instances than the returned maximum.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html#getMaxSupportedInstances()` |   |

### getProfileLevels

```
public MediaCodecInfo.CodecProfileLevel[] getProfileLevels()
```

The profile levels supported by the decoder.

| Returns |
|---|---|
| `MediaCodecInfo.CodecProfileLevel[]` | The profile levels supported by the decoder. |

### isAudioChannelCountSupported

```
public boolean isAudioChannelCountSupported(int channelCount)
```

Whether the decoder supports audio with a given channel count.

| Parameters |
|---|---|
| `int channelCount` | The channel count. |

| Returns |
|---|---|
| `boolean` | Whether the decoder supports audio with the given channel count. |

### isAudioChannelCountSupportedV21

```
@InlineMe(replacement = "this.isAudioChannelCountSupported(channelCount)")
public final boolean [isAudioChannelCountSupportedV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioChannelCountSupportedV21(int))(int channelCount)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioChannelCountSupported(int)` instead.

### isAudioSampleRateSupported

```
public boolean isAudioSampleRateSupported(int sampleRate)
```

Whether the decoder supports audio with a given sample rate.

| Parameters |
|---|---|
| `int sampleRate` | The sample rate in Hz. |

| Returns |
|---|---|
| `boolean` | Whether the decoder supports audio with the given sample rate. |

### isAudioSampleRateSupportedV21

```
@InlineMe(replacement = "this.isAudioSampleRateSupported(sampleRate)")
public final boolean [isAudioSampleRateSupportedV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioSampleRateSupportedV21(int))(int sampleRate)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isAudioSampleRateSupported(int)` instead.

### isFormatFunctionallySupported

```
public boolean isFormatFunctionallySupported(Context context, Format format)
```

Returns whether the decoder may functionally support decoding the given `format`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | A context. |
| `https://developer.android.com/reference/androidx/media3/common/Format format` | The input media format. |

| Returns |
|---|---|
| `boolean` | Whether the decoder may functionally support decoding the given `format`. |

### isFormatSupported

```
public boolean isFormatSupported(Context context, Format format)
```

Returns whether the decoder may support decoding the given `format` both functionally and performantly.

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/content/Context.html context` | A context. |
| `https://developer.android.com/reference/androidx/media3/common/Format format` | The input media format. |

| Returns |
|---|---|
| `boolean` | Whether the decoder may support decoding the given `format`. |

### isHdr10PlusOutOfBandMetadataSupported

```
public boolean isHdr10PlusOutOfBandMetadataSupported()
```

Whether the codec handles HDR10+ out-of-band metadata.

### isSeamlessAdaptationSupported

```
public boolean isSeamlessAdaptationSupported(Format format)
```

Returns whether it may be possible to adapt an instance of this decoder to playing a different format when the codec is configured to play media in the specified `format`.

For adaptation to succeed, the codec must also be configured with appropriate maximum values and `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#canReuseCodec(androidx.media3.common.Format,androidx.media3.common.Format)` must return `true` for the old/new formats.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/common/Format format` | The format of media for which the decoder will be configured. |

| Returns |
|---|---|
| `boolean` | Whether adaptation may be possible |

### isVideoSizeAndRateSupported

```
public boolean isVideoSizeAndRateSupported(int width, int height, double frameRate)
```

Whether the decoder supports video with a given width, height and frame rate.

| Parameters |
|---|---|
| `int width` | Width in pixels. |
| `int height` | Height in pixels. |
| `double frameRate` | Optional frame rate in frames per second. Ignored if set to `https://developer.android.com/reference/androidx/media3/common/Format#NO_VALUE()` or any value less than or equal to 0. |

| Returns |
|---|---|
| `boolean` | Whether the decoder supports video with the given width, height and frame rate. |

### isVideoSizeAndRateSupportedV21

```
@InlineMe(replacement = "this.isVideoSizeAndRateSupported(width, height, frameRate)")
public final boolean [isVideoSizeAndRateSupportedV21](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isVideoSizeAndRateSupportedV21(int,int,double))(int width, int height, double frameRate)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#isVideoSizeAndRateSupported(int,int,double)` instead.

### newInstance

```
public static MediaCodecInfo newInstance(
    String name,
    String mimeType,
    String codecMimeType,
    @Nullable MediaCodecInfo.CodecCapabilities capabilities,
    boolean hardwareAccelerated,
    boolean softwareOnly,
    boolean vendor
)
```

Creates an instance.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html name` | The name of the `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://developer.android.com/reference/java/lang/String.html mimeType` | A MIME type supported by the `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://developer.android.com/reference/java/lang/String.html codecMimeType` | The MIME type that the codec uses for media of type `#mimeType`. Equal to `mimeType` unless the codec is known to use a non-standard MIME type alias. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/android/media/MediaCodecInfo.CodecCapabilities.html capabilities` | The capabilities of the `https://developer.android.com/reference/android/media/MediaCodec.html` for the specified MIME type, or `null` if not known. |
| `boolean hardwareAccelerated` | Whether the `https://developer.android.com/reference/android/media/MediaCodec.html` is hardware accelerated. |
| `boolean softwareOnly` | Whether the `https://developer.android.com/reference/android/media/MediaCodec.html` is software only. |
| `boolean vendor` | Whether the `https://developer.android.com/reference/android/media/MediaCodec.html` is provided by the vendor. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo` | The created instance. |

### newInstance

```
public static MediaCodecInfo [newInstance](https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#newInstance(java.lang.String,java.lang.String,java.lang.String,android.media.MediaCodecInfo.CodecCapabilities,boolean,boolean,boolean,boolean,boolean))(
    String name,
    String mimeType,
    String codecMimeType,
    @Nullable MediaCodecInfo.CodecCapabilities capabilities,
    boolean hardwareAccelerated,
    boolean softwareOnly,
    boolean vendor,
    boolean forceDisableAdaptive,
    boolean forceSecure
)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/media3/exoplayer/mediacodec/MediaCodecInfo#newInstance(java.lang.String,java.lang.String,java.lang.String,android.media.MediaCodecInfo.CodecCapabilities,boolean,boolean,boolean)` instead.

### toString

```
public String toString()
```