提交 5e91d0ca authored 作者: José Luis Millán's avatar José Luis Millán

Apply format to RTX code

上级 818ce16b
...@@ -57,7 +57,7 @@ namespace RTC ...@@ -57,7 +57,7 @@ namespace RTC
std::unique_ptr<RTC::NackGenerator> nackGenerator; std::unique_ptr<RTC::NackGenerator> nackGenerator;
// RTX related. // RTX related.
bool hasRtx { false }; bool hasRtx{ false };
uint8_t rtxPayloadType{ 0 }; uint8_t rtxPayloadType{ 0 };
uint32_t rtxSsrc{ 0 }; uint32_t rtxSsrc{ 0 };
}; };
......
...@@ -60,7 +60,7 @@ namespace RTC ...@@ -60,7 +60,7 @@ namespace RTC
uint32_t rtt{ 0 }; // Round trip time. uint32_t rtt{ 0 }; // Round trip time.
// RTX related. // RTX related.
bool hasRtx { false }; bool hasRtx{ false };
uint8_t rtxPayloadType{ 0 }; uint8_t rtxPayloadType{ 0 };
uint32_t rtxSsrc{ 0 }; uint32_t rtxSsrc{ 0 };
uint16_t rtxSeq{ 0 }; uint16_t rtxSeq{ 0 };
......
...@@ -313,7 +313,7 @@ namespace RTC ...@@ -313,7 +313,7 @@ namespace RTC
this->SetSsrc(ssrc); this->SetSsrc(ssrc);
// Write the original sequence number at the begining of the payload. // Write the original sequence number at the begining of the payload.
std::memmove(this->payload+2, this->payload, this->payloadLength); std::memmove(this->payload + 2, this->payload, this->payloadLength);
Utils::Byte::Set2Bytes(this->payload, 0, this->GetSequenceNumber()); Utils::Byte::Set2Bytes(this->payload, 0, this->GetSequenceNumber());
// Rewrite the sequence number. // Rewrite the sequence number.
......
...@@ -247,13 +247,12 @@ namespace RTC ...@@ -247,13 +247,12 @@ namespace RTC
// Find the corresponding RtpStreamRecv. // Find the corresponding RtpStreamRecv.
uint32_t ssrc = packet->GetSsrc(); uint32_t ssrc = packet->GetSsrc();
RTC::RtpStreamRecv* rtpStream { nullptr }; RTC::RtpStreamRecv* rtpStream{ nullptr };
if (this->rtpStreams.find(ssrc) == this->rtpStreams.end()) if (this->rtpStreams.find(ssrc) == this->rtpStreams.end())
{ {
if (this->rtxStreamMap.find(ssrc) == this->rtxStreamMap.end()) if (this->rtxStreamMap.find(ssrc) == this->rtxStreamMap.end())
{ {
MS_WARN_TAG(rtp, "no RtpStream found for given RTP packet [ssrc:%" PRIu32 "]", ssrc); MS_WARN_TAG(rtp, "no RtpStream found for given RTP packet [ssrc:%" PRIu32 "]", ssrc);
return; return;
......
...@@ -494,7 +494,10 @@ namespace RTC ...@@ -494,7 +494,10 @@ namespace RTC
rtxPacket = packet->Clone(RtxBuffer); rtxPacket = packet->Clone(RtxBuffer);
this->rtpStream->RtxEncode(rtxPacket); this->rtpStream->RtxEncode(rtxPacket);
MS_DEBUG_TAG(rtx, "sending rtx packet [ssrc: %" PRIu32 " seqnr: %" PRIu16 "] recovering original [ssrc: %" PRIu32 " seqnr: %" PRIu16 "]", MS_DEBUG_TAG(
rtx,
"sending rtx packet [ssrc: %" PRIu32 " seqnr: %" PRIu16
"] recovering original [ssrc: %" PRIu32 " seqnr: %" PRIu16 "]",
rtxPacket->GetSsrc(), rtxPacket->GetSsrc(),
rtxPacket->GetSequenceNumber(), rtxPacket->GetSequenceNumber(),
packet->GetSsrc(), packet->GetSsrc(),
...@@ -504,7 +507,9 @@ namespace RTC ...@@ -504,7 +507,9 @@ namespace RTC
else else
{ {
rtxPacket = packet; rtxPacket = packet;
MS_DEBUG_TAG(rtx, "retransmitting packet [ssrc: %" PRIu32 " seqnr: %" PRIu16 "]", MS_DEBUG_TAG(
rtx,
"retransmitting packet [ssrc: %" PRIu32 " seqnr: %" PRIu16 "]",
rtxPacket->GetSsrc(), rtxPacket->GetSsrc(),
rtxPacket->GetSequenceNumber()); rtxPacket->GetSequenceNumber());
} }
......
...@@ -71,7 +71,10 @@ namespace RTC ...@@ -71,7 +71,10 @@ namespace RTC
// Check that the payload type corresponds to the one negotiated. // Check that the payload type corresponds to the one negotiated.
if (packet->GetPayloadType() != this->rtxPayloadType) if (packet->GetPayloadType() != this->rtxPayloadType)
{ {
MS_WARN_TAG(rtx, "ignoring rtx packet with invalid payload type [ssrc: %" PRIu32 " seqnr: %" PRIu16 " payload type: %" PRIu8 "]", MS_WARN_TAG(
rtx,
"ignoring rtx packet with invalid payload type [ssrc: %" PRIu32 " seqnr: %" PRIu16
" payload type: %" PRIu8 "]",
packet->GetSsrc(), packet->GetSsrc(),
packet->GetSequenceNumber(), packet->GetSequenceNumber(),
packet->GetPayloadType()); packet->GetPayloadType());
...@@ -85,7 +88,10 @@ namespace RTC ...@@ -85,7 +88,10 @@ namespace RTC
// Get the original rtp packet. // Get the original rtp packet.
if (!packet->RtxDecode(this->params.payloadType, this->params.ssrc)) if (!packet->RtxDecode(this->params.payloadType, this->params.ssrc))
{ {
MS_WARN_TAG(rtx, "ignoring malformed rtx packet [ssrc: %" PRIu32 " seqnr: %" PRIu16 " payload type: %" PRIu8 "]", MS_WARN_TAG(
rtx,
"ignoring malformed rtx packet [ssrc: %" PRIu32 " seqnr: %" PRIu16
" payload type: %" PRIu8 "]",
packet->GetSsrc(), packet->GetSsrc(),
packet->GetSequenceNumber(), packet->GetSequenceNumber(),
packet->GetPayloadType()); packet->GetPayloadType());
...@@ -93,7 +99,10 @@ namespace RTC ...@@ -93,7 +99,10 @@ namespace RTC
return false; return false;
} }
MS_DEBUG_TAG(rtx, "received rtx packet [ssrc: %" PRIu32 " seqnr: %" PRIu16 "] recovering original [ssrc: %" PRIu32 " seqnr: %" PRIu16 "]", MS_DEBUG_TAG(
rtx,
"received rtx packet [ssrc: %" PRIu32 " seqnr: %" PRIu16
"] recovering original [ssrc: %" PRIu32 " seqnr: %" PRIu16 "]",
this->rtxSsrc, this->rtxSsrc,
rtxSeq, rtxSeq,
packet->GetSsrc(), packet->GetSsrc(),
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论