MediaCodecString Class
A codec string of the WebCodecs codec registry (https://w3c.github.io/webcodecs/codec_registry.html), parsed by MediaCodecString.TryParse: the codec and, for the video codecs, the profile, the level and the bit depth. The strings are case-sensitive and must be exact: an ambiguous string (e.g. vp9), a string with spaces, or a string whose profile or level is not defined (e.g. vp09.99.99.08) is rejected. A MediaCodecBackend can use it to answer the support of the configurations.
public sealed class MediaCodecStringProperties
| Name | Description |
|---|---|
| BitDepth | Gets the bit depth of the samples of a video codec (8 when the string does not give it). |
| Codec | Gets the codec. |
| IsAudio | Gets a value indicating whether the codec is an audio codec. |
| IsHighTier | Gets a value indicating whether the string has the high tier of AV1 or HEVC. |
| Level | Gets the level: the seq_level_idx of AV1, the level_idc of AVC and HEVC, the level of VP9 (e.g. 10 for 1.0); 0 otherwise. |
| Profile | Gets the profile: the seq_profile of AV1, the profile_idc of AVC, the general_profile_idc of HEVC, the profile of VP9, the object type of AAC; 0 otherwise. |
| Value | Gets the codec string. |
BitDepth
MediaCodecString.csCodec
MediaCodecString.csIsAudio
MediaCodecString.csIsHighTier
MediaCodecString.csLevel
MediaCodecString.csProfile
MediaCodecString.csValue
MediaCodecString.csMethods
| Name | Description |
|---|---|
| ToString() | Returns a string that represents the current object. |
| TryParse(string?, MediaCodecString?) | Parses a codec string of the registry. |
ToString()
MediaCodecString.csTryParse(string?, MediaCodecString?)
MediaCodecString.csParses a codec string of the registry.
public static bool TryParse(string? value, out MediaCodecString? result)Parameters
valuestring?- The codec string.
resultMediaCodecString?- The parsed codec string, or null.
Returns
bool Whether the string is a valid codec string of the registry.