protected void OnPacketReceived(RtcpPacketReceivedArgs args) { if (PacketReceived != null) { PacketReceived(this, args); } }
protected void RtcpPacketReceived(object sender, RtcpPacketReceivedArgs e) { if (e.Packet is RtcpAppPacket) { RtcpAppPacket apppacket = (RtcpAppPacket)e.Packet; var m = RegexDescribeResponseSignalInfo.Match(apppacket.Data); if (m.Success) { _signalLocked = m.Groups[2].Captures[0].Value.Equals("1"); _signalLevel = int.Parse(m.Groups[1].Captures[0].Value) * 100 / 255; // level: 0..255 => 0..100 _signalQuality = int.Parse(m.Groups[3].Captures[0].Value) * 100 / 15; // quality: 0..15 => 0..100 } OnRecieptionInfoChanged(new RecieptionInfoArgs(_signalLocked, _signalLevel, _signalQuality)); } else if (e.Packet is RtcpByePacket) { TearDown(); } }