?? bandwidthfield.cs
字號:
using System;
namespace SDP
{
/// <summary>
/// A Bandwidth represents the b= field within MediaDescriptions and SessionDescriptions.
///
/// This specifies the proposed bandwidth to be used by the session or media, and is optional.
/// Multiple bandwidth specifiers of different types may be associated with the same
/// SessionDescription. Each consists of a token type and an integer value measuring the
/// bandwidth in kilobits per second.
/// </summary>
public class BandwidthField : Field
{
private string modifier;
/// <summary>
/// Gets the bandwidth modifier.
/// </summary>
public string Modifier
{
get { return this.modifier; }
}
private int bandwidth;
/// <summary>
/// Gets the bandwidth value in kilobits per second.
/// </summary>
public int Bandwidth
{
get { return this.bandwidth; }
}
/// <summary>
/// Creates a new BandwidthField
/// </summary>
/// <param name="modifier">The bandwidth modifier. Usually either "CT" or "AS".</param>
/// <param name="bandwidth">The maximum bandwidth in kilobits per second.</param>
public BandwidthField(string modifier, int bandwidth)
: base("b", modifier + ":" + bandwidth)
{
this.modifier = modifier;
this.bandwidth = bandwidth;
}
/// <summary>
/// Creates a new BandwidthField
/// </summary>
/// <param name="value">The field's value.</param>
public BandwidthField(string value)
: base("b=" + value)
{
string val = base.Value;
string[] parts = val.Split(':');
if (parts.Length != 2) throw new ArgumentException("Invalid bandwidth field.");
this.modifier = parts[0];
this.bandwidth = int.Parse(parts[1]);
}
/// <summary>
/// Gets the value portion of the field.
/// </summary>
public override string Value
{
get { return modifier + ":" + bandwidth; }
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -