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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|
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 |
---|---|---|
MediaCodecInfo | codecInfo | The codec information. |
System.String | mimeType | Type of the MIME. |
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 |
---|---|---|
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 |
---|---|---|
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()