Class MediaCodecUtility
The MediaCodec utility.
Inheritance
Inherited Members
Namespace: FM.LiveSwitch.Android
Assembly: FM.LiveSwitch.Android.dll
Syntax
public class MediaCodecUtility
  Methods
GetColorFormat(VideoFormat)
Gets the color format.
Declaration
public static MediaCodecCapabilities GetColorFormat(VideoFormat format)
  Parameters
| Type | Name | Description | 
|---|---|---|
| VideoFormat | format | The format.  | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecCapabilities | 
GetDecoderInfos(String)
Gets the decoder info.
Declaration
public static MediaCodecInfo[] GetDecoderInfos(string mimeType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecInfo[] | 
GetDecoderInfos(String, Int32)
Gets the decoder info.
Declaration
public static MediaCodecInfo[] GetDecoderInfos(string mimeType, int colorFormat)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
| System.Int32 | colorFormat | The color format.  | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecInfo[] | 
GetDecoderInfos(String, Int32, Boolean)
Gets the decoder info.
Declaration
public static MediaCodecInfo[] GetDecoderInfos(string mimeType, int colorFormat, bool hardwareAcceleratedOnly)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
| System.Int32 | colorFormat | The color format.  | 
      
| System.Boolean | hardwareAcceleratedOnly | if set to   | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecInfo[] | 
GetEncoderInfos(String)
Gets the encoder info.
Declaration
public static MediaCodecInfo[] GetEncoderInfos(string mimeType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecInfo[] | 
GetEncoderInfos(String, Int32)
Gets the encoder info.
Declaration
public static MediaCodecInfo[] GetEncoderInfos(string mimeType, int colorFormat)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
| System.Int32 | colorFormat | The color format.  | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecInfo[] | 
GetEncoderInfos(String, Int32, Boolean)
Gets the encoder info.
Declaration
public static MediaCodecInfo[] GetEncoderInfos(string mimeType, int colorFormat, bool hardwareAcceleratedOnly)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
| System.Int32 | colorFormat | The color format.  | 
      
| System.Boolean | hardwareAcceleratedOnly | if set to   | 
      
Returns
| Type | Description | 
|---|---|
| Android.Media.MediaCodecInfo[] | 
GetFormatName(String)
Gets the name of the format.
Declaration
public static string GetFormatName(string mimeType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | 
GetMimeType(AudioFormat)
Gets the type of the MIME.
Declaration
public static string GetMimeType(AudioFormat audioFormat)
  Parameters
| Type | Name | Description | 
|---|---|---|
| AudioFormat | audioFormat | The audio format.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | 
GetMimeType(VideoFormat)
Gets the type of the MIME.
Declaration
public static string GetMimeType(VideoFormat videoFormat)
  Parameters
| Type | Name | Description | 
|---|---|---|
| VideoFormat | videoFormat | The video format.  | 
      
Returns
| Type | Description | 
|---|---|
| System.String | 
HasColorFormat(MediaCodecInfo, String, MediaCodecCapabilities)
Determines whether the specified codec and MIME type supports the specified color format.
Declaration
public static bool HasColorFormat(MediaCodecInfo codecInfo, string mimeType, MediaCodecCapabilities colorFormat)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Android.Media.MediaCodecInfo | codecInfo | The codec information.  | 
      
| System.String | mimeType | Type of the MIME.  | 
      
| Android.Media.MediaCodecCapabilities | colorFormat | The color format.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
HasMimeType(MediaCodecInfo, String)
Determines whether the specified codec has the specified MIME type.
Declaration
public static bool HasMimeType(MediaCodecInfo codecInfo, string mimeType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Android.Media.MediaCodecInfo | codecInfo | The codec information.  | 
      
| System.String | mimeType | Type of the MIME.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
IsAudio(String)
Determines whether the specified MIME type is audio.
Declaration
public static bool IsAudio(string mimeType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
IsHardwareAccelerated(MediaCodecInfo)
Determines whether the specified codec is hardware accelerated.
Declaration
public static bool IsHardwareAccelerated(MediaCodecInfo codecInfo)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Android.Media.MediaCodecInfo | codecInfo | The codec information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
IsVideo(String)
Determines whether the specified MIME type is video.
Declaration
public static bool IsVideo(string mimeType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | mimeType | Type of the MIME.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
LogAvailableCodecs()
Logs the available codecs.
Declaration
public static void LogAvailableCodecs()