Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc

Issue 2919313005: Revert of Only compare sequence numbers from the same SSRC in ForwardErrorCorrection. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc
diff --git a/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc b/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc
index 922fe2f9a548d0bb4692e9defd2a6679bab5e6cd..4aaae9885284669cff87da837a5b40baae9fd542 100644
--- a/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc
+++ b/webrtc/modules/rtp_rtcp/test/testFec/test_fec.cc
@@ -78,7 +78,13 @@
}
}
-void RunTest(bool use_flexfec) {
+// Too slow to finish before timeout on iOS. See webrtc:4755.
+#if defined(WEBRTC_IOS)
+#define MAYBE_FecTest DISABLED_FecTest
+#else
+#define MAYBE_FecTest FecTest
+#endif
+TEST(FecTest, MAYBE_FecTest) {
// TODO(marpan): Split this function into subroutines/helper functions.
enum { kMaxNumberMediaPackets = 48 };
enum { kMaxNumberFecPackets = 48 };
@@ -101,13 +107,8 @@
ASSERT_EQ(12, kMaxMediaPackets[1]) << "Max media packets for bursty mode not "
<< "equal to 12.";
- std::unique_ptr<ForwardErrorCorrection> fec;
- if (use_flexfec) {
- fec = ForwardErrorCorrection::CreateFlexfec();
- } else {
- fec = ForwardErrorCorrection::CreateUlpfec();
- }
-
+ std::unique_ptr<ForwardErrorCorrection> fec =
+ ForwardErrorCorrection::CreateUlpfec();
ForwardErrorCorrection::PacketList media_packet_list;
std::list<ForwardErrorCorrection::Packet*> fec_packet_list;
ForwardErrorCorrection::ReceivedPacketList to_decode_list;
@@ -137,16 +138,7 @@
uint16_t seq_num = 0;
uint32_t timestamp = random.Rand<uint32_t>();
- const uint32_t media_ssrc = random.Rand(1u, 0xfffffffe);
- uint32_t fec_ssrc;
- uint16_t fec_seq_num_offset;
- if (use_flexfec) {
- fec_ssrc = random.Rand(1u, 0xfffffffe);
- fec_seq_num_offset = random.Rand<uint16_t>();
- } else {
- fec_ssrc = media_ssrc;
- fec_seq_num_offset = 0;
- }
+ const uint32_t ssrc = random.Rand(1u, 0xfffffffe);
// Loop over the mask types: random and bursty.
for (int mask_type_idx = 0; mask_type_idx < kNumFecMaskTypes;
@@ -276,7 +268,7 @@
ByteWriter<uint32_t>::WriteBigEndian(&media_packet->data[4],
timestamp);
ByteWriter<uint32_t>::WriteBigEndian(&media_packet->data[8],
- media_ssrc);
+ ssrc);
// Generate random values for payload
for (size_t j = 12; j < media_packet->length; ++j) {
media_packet->data[j] = random.Rand<uint8_t>();
@@ -310,7 +302,6 @@
received_packet->pkt->length = media_packet->length;
memcpy(received_packet->pkt->data, media_packet->data,
media_packet->length);
- received_packet->ssrc = media_ssrc;
received_packet->seq_num =
ByteReader<uint16_t>::ReadBigEndian(&media_packet->data[2]);
received_packet->is_fec = false;
@@ -332,9 +323,9 @@
received_packet->pkt->length = fec_packet->length;
memcpy(received_packet->pkt->data, fec_packet->data,
fec_packet->length);
- received_packet->seq_num = fec_seq_num_offset + seq_num;
+ received_packet->seq_num = seq_num;
received_packet->is_fec = true;
- received_packet->ssrc = fec_ssrc;
+ received_packet->ssrc = ssrc;
received_packet_list.push_back(std::move(received_packet));
fec_mask_list.push_back(fec_packet_masks[fec_packet_idx]);
@@ -462,21 +453,5 @@
<< "Recovered packet list is not empty";
}
-// Too slow to finish before timeout on iOS. See webrtc:4755.
-#if defined(WEBRTC_IOS)
-#define MAYBE_UlpecTest DISABLED_UlpecTest
-#define MAYBE_FlexfecTest DISABLED_FlexfecTest
-#else
-#define MAYBE_UlpecTest UlpecTest
-#define MAYBE_FlexfecTest FlexfecTest
-#endif
-TEST(FecTest, MAYBE_UlpecTest) {
- RunTest(false);
-}
-
-TEST(FecTest, MAYBE_FlexfecTest) {
- RunTest(true);
-}
-
} // namespace test
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/ulpfec_receiver_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698