# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Nested Classes | Methods | Inherited Methods

# MediaCodecInfo

`public final class MediaCodecInfo`
`extends Object` ``

java.lang.Object
↳ | android.media.MediaCodecInfo

Provides information about a given media codec available on the device. You can iterate through all codecs available by querying `MediaCodecList`. For example, here's how to find an encoder that supports a given MIME type:

     private static MediaCodecInfo selectCodec(String mimeType) {
         int numCodecs = MediaCodecList.getCodecCount();
         for (int i = 0; i < numCodecs; i++) {
             MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);

             if (!codecInfo.isEncoder()) {
                 continue;
             }

             String[] types = codecInfo.getSupportedTypes();
             for (int j = 0; j < types.length; j++) {
                 if (types[j].equalsIgnoreCase(mimeType)) {
                     return codecInfo;
                 }
             }
         }
         return null;
     }

## Summary

### Nested classes
`class` | `MediaCodecInfo.AudioCapabilities` A class that supports querying the audio capabilities of a codec.
`class` | `MediaCodecInfo.CodecCapabilities` Encapsulates the capabilities of a given codec component.
`class` | `MediaCodecInfo.CodecProfileLevel` Encapsulates the profiles available for a codec component.
`class` | `MediaCodecInfo.EncoderCapabilities` A class that supports querying the encoding capabilities of a codec.
`class` | `MediaCodecInfo.VideoCapabilities` A class that supports querying the video capabilities of a codec.

### Public methods
`String` | `getCanonicalName()` Retrieve the underlying codec name.
`MediaCodecInfo.CodecCapabilities` | `getCapabilitiesForType(String type)` Enumerates the capabilities of the codec component.
`String` | `getName()` Retrieve the codec name.
`String[]` | `getSupportedTypes()` Query the media types supported by the codec.
`boolean` | `isAlias()` Query if the codec is an alias for another underlying codec.
`boolean` | `isEncoder()` Query if the codec is an encoder.
`boolean` | `isHardwareAccelerated()` Query if the codec is hardware accelerated.
`boolean` | `isSoftwareOnly()` Query if the codec is software only.
`boolean` | `isVendor()` Query if the codec is provided by the Android platform (false) or the device manufacturer (true).

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public methods

### getCanonicalName

    public String getCanonicalName ()

Retrieve the underlying codec name. Device implementations may provide multiple aliases (codec names) for the same underlying codec to maintain backward app compatibility. This method returns the name of the underlying codec name, which must not be another alias. For non-aliases this is always the name of the codec.

Returns
`String` | This value cannot be `null`.

### getCapabilitiesForType

    public MediaCodecInfo.CodecCapabilities getCapabilitiesForType (String type)

Enumerates the capabilities of the codec component. Since a single component can support data of a variety of types, the type has to be specified to yield a meaningful result.

Parameters
`type` | `String`: The MIME type to query

Returns
`MediaCodecInfo.CodecCapabilities` |

### getName

    public String getName ()

Retrieve the codec name. Note: Implementations may provide multiple aliases (codec names) for the same underlying codec, any of which can be used to instantiate the same underlying codec in `MediaCodec#createByCodecName`. Applications targeting SDK < `Build.VERSION_CODES.Q`, cannot determine if the multiple codec names listed in MediaCodecList are in-fact for the same codec.

Returns
`String` | This value cannot be `null`.

### getSupportedTypes

    public String[] getSupportedTypes ()

Query the media types supported by the codec.

Returns
`String[]` |

### isAlias

    public boolean isAlias ()

Query if the codec is an alias for another underlying codec.

Returns
`boolean` |

### isEncoder

    public boolean isEncoder ()

Query if the codec is an encoder.

Returns
`boolean` |

### isHardwareAccelerated

    public boolean isHardwareAccelerated ()

Query if the codec is hardware accelerated. This attribute is provided by the device manufacturer. Note that it cannot be tested for correctness.

Returns
`boolean` |

### isSoftwareOnly

    public boolean isSoftwareOnly ()

Query if the codec is software only. Software-only codecs are more secure as they run in a tighter security sandbox. On the other hand, software-only codecs do not provide any performance guarantees.

Returns
`boolean` |

### isVendor

    public boolean isVendor ()

Query if the codec is provided by the Android platform (false) or the device manufacturer (true).

Returns
`boolean` |

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*