Reformat the WebRTC code base
Running clang-format with chromium's style guide. The goal is n-fold: * providing consistency and readability (that's what code guidelines are for) * preventing noise with presubmit checks and git cl format * building on the previous point: making it easier to automatically fix format issues * you name it Please consider using git-hyper-blame to ignore this commit. Bug: webrtc:9340 Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87 Reviewed-on: https://webrtc-review.googlesource.com/81185 Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
@ -155,19 +155,19 @@ bool RtpFecTest<ForwardErrorCorrectionType>::IsRecoveryComplete() {
|
||||
|
||||
// All recovered packets must be identical to the corresponding
|
||||
// original packets.
|
||||
auto cmp = [](
|
||||
const std::unique_ptr<ForwardErrorCorrection::Packet>& media_packet,
|
||||
const std::unique_ptr<ForwardErrorCorrection::RecoveredPacket>&
|
||||
recovered_packet) {
|
||||
if (media_packet->length != recovered_packet->pkt->length) {
|
||||
return false;
|
||||
}
|
||||
if (memcmp(media_packet->data, recovered_packet->pkt->data,
|
||||
media_packet->length) != 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
auto cmp =
|
||||
[](const std::unique_ptr<ForwardErrorCorrection::Packet>& media_packet,
|
||||
const std::unique_ptr<ForwardErrorCorrection::RecoveredPacket>&
|
||||
recovered_packet) {
|
||||
if (media_packet->length != recovered_packet->pkt->length) {
|
||||
return false;
|
||||
}
|
||||
if (memcmp(media_packet->data, recovered_packet->pkt->data,
|
||||
media_packet->length) != 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
return std::equal(media_packets_.cbegin(), media_packets_.cend(),
|
||||
recovered_packets_.cbegin(), cmp);
|
||||
}
|
||||
@ -286,8 +286,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNoLoss) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// No packets lost, expect complete recovery.
|
||||
@ -318,8 +317,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// One packet lost, one FEC packet, expect complete recovery.
|
||||
@ -334,8 +332,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// 2 packets lost, one FEC packet, cannot get complete recovery.
|
||||
@ -398,8 +395,7 @@ TYPED_TEST(RtpFecTest, NoFecRecoveryWithOldFecPacket) {
|
||||
this->ReceivedPackets(this->media_packets_, this->media_loss_mask_, false);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Expect that no decoding is done to get missing packet (seq#0) of third
|
||||
@ -441,8 +437,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithSeqNumGapOneFrameRecovery) {
|
||||
true);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Expect 3 media packets in recovered list, and complete recovery.
|
||||
@ -493,8 +488,7 @@ TEST_F(RtpFecTestUlpfecOnly, FecRecoveryWithSeqNumGapOneFrameRecovery) {
|
||||
true);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// The two FEC packets are received and should allow for complete recovery,
|
||||
@ -552,8 +546,7 @@ TEST_F(RtpFecTestFlexfecOnly, FecRecoveryWithSeqNumGapOneFrameNoRecovery) {
|
||||
true);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// The two FEC packets are received and should allow for complete recovery,
|
||||
@ -598,8 +591,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithMediaOutOfOrder) {
|
||||
std::swap(*it0, *it1);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Expect 3 media packets in recovered list, and complete recovery.
|
||||
@ -638,8 +630,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithFecOutOfOrder) {
|
||||
this->ReceivedPackets(this->media_packets_, this->media_loss_mask_, false);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Expect 3 media packets in recovered list, and complete recovery.
|
||||
@ -687,8 +678,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percRandomMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// With media packet#1 and FEC packets #1, #2, #3, expect complete recovery.
|
||||
@ -705,8 +695,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percRandomMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Cannot get complete recovery for this loss configuration with random mask.
|
||||
@ -753,8 +742,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percBurstyMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Expect complete recovery for consecutive packet loss <= 50%.
|
||||
@ -771,8 +759,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percBurstyMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Expect complete recovery for consecutive packet loss <= 50%.
|
||||
@ -789,8 +776,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percBurstyMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Cannot get complete recovery for this loss configuration.
|
||||
@ -820,8 +806,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNoLossUep) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// No packets lost, expect complete recovery.
|
||||
@ -852,8 +837,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLossUep) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// One packet lost, one FEC packet, expect complete recovery.
|
||||
@ -868,8 +852,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLossUep) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// 2 packets lost, one FEC packet, cannot get complete recovery.
|
||||
@ -914,8 +897,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percUepRandomMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// With media packet#3 and FEC packets #0, #1, #3, expect complete recovery.
|
||||
@ -933,8 +915,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryWithLoss50percUepRandomMask) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Cannot get complete recovery for this loss configuration.
|
||||
@ -970,8 +951,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePackets) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// One packet lost, one FEC packet, expect complete recovery.
|
||||
@ -985,8 +965,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePackets) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Unprotected packet lost. Recovery not possible.
|
||||
@ -1001,8 +980,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePackets) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// 2 protected packets lost, one FEC packet, cannot get complete recovery.
|
||||
@ -1041,8 +1019,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePacketsExtension) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// One packet lost, one FEC packet, expect complete recovery.
|
||||
@ -1056,8 +1033,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePacketsExtension) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Unprotected packet lost. Recovery not possible.
|
||||
@ -1076,8 +1052,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePacketsExtension) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// 5 protected packets lost, one FEC packet, cannot get complete recovery.
|
||||
@ -1116,8 +1091,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePacketsWrap) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// One packet lost, one FEC packet, expect complete recovery.
|
||||
@ -1131,8 +1105,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePacketsWrap) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// Unprotected packet lost. Recovery not possible.
|
||||
@ -1151,8 +1124,7 @@ TYPED_TEST(RtpFecTest, FecRecoveryNonConsecutivePacketsWrap) {
|
||||
this->NetworkReceivedPackets(this->media_loss_mask_, this->fec_loss_mask_);
|
||||
|
||||
for (const auto& received_packet : this->received_packets_) {
|
||||
this->fec_.DecodeFec(*received_packet,
|
||||
&this->recovered_packets_);
|
||||
this->fec_.DecodeFec(*received_packet, &this->recovered_packets_);
|
||||
}
|
||||
|
||||
// 5 protected packets lost, one FEC packet, cannot get complete recovery.
|
||||
|
||||
Reference in New Issue
Block a user