OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 fclose(random_seed_file); | 128 fclose(random_seed_file); |
129 random_seed_file = nullptr; | 129 random_seed_file = nullptr; |
130 | 130 |
131 uint16_t seq_num = 0; | 131 uint16_t seq_num = 0; |
132 uint32_t timestamp = random.Rand<uint32_t>(); | 132 uint32_t timestamp = random.Rand<uint32_t>(); |
133 const uint32_t media_ssrc = random.Rand(1u, 0xfffffffe); | 133 const uint32_t media_ssrc = random.Rand(1u, 0xfffffffe); |
134 uint32_t fec_ssrc; | 134 uint32_t fec_ssrc; |
135 uint16_t fec_seq_num_offset; | 135 uint16_t fec_seq_num_offset; |
136 if (use_flexfec) { | 136 if (use_flexfec) { |
137 fec_ssrc = random.Rand(1u, 0xfffffffe); | 137 fec_ssrc = random.Rand(1u, 0xfffffffe); |
138 fec_seq_num_offset = random.Rand<uint16_t>(); | 138 fec_seq_num_offset = random.Rand(0, 1 << 15); |
139 } else { | 139 } else { |
140 fec_ssrc = media_ssrc; | 140 fec_ssrc = media_ssrc; |
141 fec_seq_num_offset = 0; | 141 fec_seq_num_offset = 0; |
142 } | 142 } |
143 | 143 |
144 std::unique_ptr<ForwardErrorCorrection> fec; | 144 std::unique_ptr<ForwardErrorCorrection> fec; |
145 if (use_flexfec) { | 145 if (use_flexfec) { |
146 fec = ForwardErrorCorrection::CreateFlexfec(fec_ssrc, media_ssrc); | 146 fec = ForwardErrorCorrection::CreateFlexfec(fec_ssrc, media_ssrc); |
147 } else { | 147 } else { |
148 RTC_DCHECK_EQ(media_ssrc, fec_ssrc); | 148 RTC_DCHECK_EQ(media_ssrc, fec_ssrc); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 } // loop over mask types | 458 } // loop over mask types |
459 | 459 |
460 // Have DecodeFec clear the recovered packet list. | 460 // Have DecodeFec clear the recovered packet list. |
461 fec->ResetState(&recovered_packet_list); | 461 fec->ResetState(&recovered_packet_list); |
462 ASSERT_TRUE(recovered_packet_list.empty()) | 462 ASSERT_TRUE(recovered_packet_list.empty()) |
463 << "Recovered packet list is not empty"; | 463 << "Recovered packet list is not empty"; |
464 } | 464 } |
465 | 465 |
466 // Too slow to finish before timeout on iOS. See webrtc:4755. | 466 // Too slow to finish before timeout on iOS. See webrtc:4755. |
467 #if defined(WEBRTC_IOS) | 467 #if defined(WEBRTC_IOS) |
468 #define MAYBE_UlpecTest DISABLED_UlpecTest | 468 #define MAYBE_UlpfecTest DISABLED_UlpfecTest |
469 #define MAYBE_FlexfecTest DISABLED_FlexfecTest | 469 #define MAYBE_FlexfecTest DISABLED_FlexfecTest |
470 #else | 470 #else |
471 #define MAYBE_UlpecTest UlpecTest | 471 #define MAYBE_UlpfecTest UlpfecTest |
472 #define MAYBE_FlexfecTest FlexfecTest | 472 #define MAYBE_FlexfecTest FlexfecTest |
473 #endif | 473 #endif |
474 TEST(FecTest, MAYBE_UlpecTest) { | 474 TEST(FecTest, MAYBE_UlpfecTest) { |
475 RunTest(false); | 475 RunTest(false); |
476 } | 476 } |
477 | 477 |
478 TEST(FecTest, MAYBE_FlexfecTest) { | 478 TEST(FecTest, MAYBE_FlexfecTest) { |
479 RunTest(true); | 479 RunTest(true); |
480 } | 480 } |
481 | 481 |
482 } // namespace test | 482 } // namespace test |
483 } // namespace webrtc | 483 } // namespace webrtc |
OLD | NEW |