Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/SIPSorcery/net/RTCP/RTCPFeedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,23 +172,23 @@ public RTCPFeedback(byte[] packet)

switch (Header)
{
case var x when x.PacketType == RTCPReportTypesEnum.RTPFB && x.FeedbackMessageType == RTCPFeedbackTypesEnum.RTCP_SR_REQ:
case var h when h.PacketType == RTCPReportTypesEnum.RTPFB && h.FeedbackMessageType == RTCPFeedbackTypesEnum.RTCP_SR_REQ:
SENDER_PAYLOAD_SIZE = 8;
Comment thread
sipsorcery marked this conversation as resolved.
// PLI feedback reports do no have any additional parameters.
break;
case var x when x.PacketType == RTCPReportTypesEnum.RTPFB:
case var h when h.PacketType == RTCPReportTypesEnum.RTPFB:
SENDER_PAYLOAD_SIZE = 12;
PID = BinaryPrimitives.ReadUInt16BigEndian(packet.AsSpan(payloadIndex + 8));
BLP = BinaryPrimitives.ReadUInt16BigEndian(packet.AsSpan(payloadIndex + 10));
break;

case var x when x.PacketType == RTCPReportTypesEnum.PSFB && x.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.PLI:
case var h when h.PacketType == RTCPReportTypesEnum.PSFB && h.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.PLI:
SENDER_PAYLOAD_SIZE = 8;
break;

// We have a lot of different kind of extension messages
// In case below we will handle the specific REMB Message https://datatracker.ietf.org/doc/html/draft-alvestrand-rmcat-remb-03#page-3
case var x when x.PacketType == RTCPReportTypesEnum.PSFB && x.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.AFB:
case var h when h.PacketType == RTCPReportTypesEnum.PSFB && h.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.AFB:

// 0 1 2 3
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
Expand Down Expand Up @@ -267,17 +267,17 @@ public byte[] GetBytes()

switch (Header)
{
case var x when x.PacketType == RTCPReportTypesEnum.RTPFB && x.FeedbackMessageType == RTCPFeedbackTypesEnum.RTCP_SR_REQ:
case var h when h.PacketType == RTCPReportTypesEnum.RTPFB && h.FeedbackMessageType == RTCPFeedbackTypesEnum.RTCP_SR_REQ:
// PLI feedback reports do no have any additional parameters.
break;
case var x when x.PacketType == RTCPReportTypesEnum.RTPFB:
case var h when h.PacketType == RTCPReportTypesEnum.RTPFB:
BinaryPrimitives.WriteUInt16BigEndian(buffer.AsSpan(payloadIndex + 8), PID);
BinaryPrimitives.WriteUInt16BigEndian(buffer.AsSpan(payloadIndex + 10), BLP);
break;

case var x when x.PacketType == RTCPReportTypesEnum.PSFB && x.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.PLI:
case var h when h.PacketType == RTCPReportTypesEnum.PSFB && h.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.PLI:
break;
case var x when x.PacketType == RTCPReportTypesEnum.PSFB && x.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.AFB:
case var h when h.PacketType == RTCPReportTypesEnum.PSFB && h.PayloadFeedbackMessageType == PSFBFeedbackTypesEnum.AFB:

// There's have a lot of different kind of extension messages
// In case below we will handle the specific REMB Message https://datatracker.ietf.org/doc/html/draft-alvestrand-rmcat-remb-03#page-3
Expand Down
2 changes: 1 addition & 1 deletion src/SIPSorcery/net/RTCP/RTCPHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public byte[] GetHeader(int receptionReportCount, UInt16 length)
{
if (receptionReportCount > MAX_RECEPTIONREPORT_COUNT)
{
throw new ApplicationException("The Reception Report Count value cannot be larger than " + MAX_RECEPTIONREPORT_COUNT + ".");
throw new ApplicationException($"The Reception Report Count value cannot be larger than {MAX_RECEPTIONREPORT_COUNT}.");
}

ReceptionReportCount = receptionReportCount;
Expand Down
4 changes: 1 addition & 3 deletions src/SIPSorcery/net/RTCP/RTCPTWCCFeedback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,7 @@ public override string ToString()
var packetStatusInfo = string.Join(", ", PacketStatuses.Select(ps =>
$"Seq:{ps.SequenceNumber}({ps.Status}{(ps.Delta.HasValue ? $",Δ:{ps.Delta.Value}" : "")})"));

return $"TWCC Feedback: SenderSSRC={SenderSSRC}, MediaSSRC={MediaSSRC}, BaseSeq={BaseSequenceNumber}, " +
$"StatusCount={PacketStatusCount}, RefTime={ReferenceTime} (1/64 sec), " +
$"FbkPktCount={FeedbackPacketCount}, PacketStatuses=[{packetStatusInfo}]";
return $"TWCC Feedback: SenderSSRC={SenderSSRC}, MediaSSRC={MediaSSRC}, BaseSeq={BaseSequenceNumber}, StatusCount={PacketStatusCount}, RefTime={ReferenceTime} (1/64 sec), FbkPktCount={FeedbackPacketCount}, PacketStatuses=[{packetStatusInfo}]";
}

#region Helper Methods
Expand Down
Loading