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 MediaCodecString

Properties

NameDescription
BitDepthGets the bit depth of the samples of a video codec (8 when the string does not give it).
CodecGets the codec.
IsAudioGets a value indicating whether the codec is an audio codec.
IsHighTierGets a value indicating whether the string has the high tier of AV1 or HEVC.
LevelGets 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.
ProfileGets 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.
ValueGets the codec string.

Gets the bit depth of the samples of a video codec (8 when the string does not give it).

public int BitDepth { get; }

Property value

int

Gets the codec.

public MediaCodec Codec { get; }

Property value

MediaCodec

Gets a value indicating whether the codec is an audio codec.

public bool IsAudio { get; }

Property value

bool

Gets a value indicating whether the string has the high tier of AV1 or HEVC.

public bool IsHighTier { get; }

Property value

bool

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.

public int Level { get; }

Property value

int

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.

public int Profile { get; }

Property value

int

Gets the codec string.

public string Value { get; }

Property value

string

Methods

NameDescription
ToString()Returns a string that represents the current object.
TryParse(string?, MediaCodecString?)Parses a codec string of the registry.

Returns a string that represents the current object.

public override string ToString()

Returns

string A string that represents the current object.

TryParse(string?, MediaCodecString?)

MediaCodecString.cs

Parses a codec string of the registry.

public static bool TryParse(string? value, out MediaCodecString? result)

Parameters

value string?
The codec string.
result MediaCodecString?
The parsed codec string, or null.

Returns

bool Whether the string is a valid codec string of the registry.