ScalabilityMode/ScalabilityMode.cs
/// <summary>
/// Parses the given scalabilityMode string according to the rules in webrtc-svc.
/// </summary>
/// <param name="scalabilityMode"></param>
/// <returns></returns>
Parses the given scalabilityMode string according to the rules in webrtc-svc.
Parses the given scalabilityMode string according to the rules in webrtc - svc .
public static ScalabilityMode Parse(string scalabilityMode)
        {
            var match = ScalabilityModeRegex.Match(scalabilityMode);
            var result = new ScalabilityMode();
            if (match.Success)
            {
                result.SpatialLayers = int.Parse(match.Groups[1].Value);
                result.TemporalLayers = int.Parse(match.Groups[2].Value);
                result.Ksvc = match.Groups.Count >= 4 && !match.Groups[3].Value.IsNullOrWhiteSpace();
            }
            else
            {
                result.SpatialLayers = 1;
                result.TemporalLayers = 1;
                result.Ksvc = false;
            }
            return result;
        }
public static ScalabilityMode Parse ( string scalabilityMode ) { var match = ScalabilityModeRegex . Match ( scalabilityMode ) ; var result = new ScalabilityMode ( ) ; if ( match . Success ) { result . SpatialLayers = int . Parse ( match . Groups [ 1 ] . Value ) ; result . TemporalLayers = int . Parse ( match . Groups [ 2 ] . Value ) ; result . Ksvc = match . Groups . Count >= 4 && ! match . Groups [ 3 ] . Value . IsNullOrWhiteSpace ( ) ; } else { result . SpatialLayers = 1 ; result . TemporalLayers = 1 ; result . Ksvc = false ; } return result ; }
Parses the given scalabilityMode string according to the rules in webrtc-svc.
Parses the given scalabilityMode string according to the rules in webrtc - svc .
None
scalabilityMode
string
None