| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2730 | 2730 |
| 2731 EXPECT_TRUE(configured_ssrcs_[ssrc]) | 2731 EXPECT_TRUE(configured_ssrcs_[ssrc]) |
| 2732 << "Received SSRC that wasn't configured: " << ssrc; | 2732 << "Received SSRC that wasn't configured: " << ssrc; |
| 2733 | 2733 |
| 2734 std::map<uint32_t, uint16_t>::iterator it = | 2734 std::map<uint32_t, uint16_t>::iterator it = |
| 2735 last_observed_sequence_number_.find(header.ssrc); | 2735 last_observed_sequence_number_.find(header.ssrc); |
| 2736 if (it == last_observed_sequence_number_.end()) { | 2736 if (it == last_observed_sequence_number_.end()) { |
| 2737 last_observed_sequence_number_[ssrc] = sequence_number; | 2737 last_observed_sequence_number_[ssrc] = sequence_number; |
| 2738 last_observed_timestamp_[ssrc] = timestamp; | 2738 last_observed_timestamp_[ssrc] = timestamp; |
| 2739 } else { | 2739 } else { |
| 2740 // We shouldn't get replays of previous sequence numbers. |
| 2741 EXPECT_NE(sequence_number, last_observed_sequence_number_[ssrc]); |
| 2740 // Verify sequence numbers are reasonably close. | 2742 // Verify sequence numbers are reasonably close. |
| 2741 uint32_t extended_sequence_number = sequence_number; | 2743 uint32_t extended_sequence_number = sequence_number; |
| 2742 // Check for roll-over. | 2744 // Check for roll-over. |
| 2743 if (sequence_number < last_observed_sequence_number_[ssrc]) | 2745 if (sequence_number < last_observed_sequence_number_[ssrc]) |
| 2744 extended_sequence_number += 0xFFFFu + 1; | 2746 extended_sequence_number += 0xFFFFu + 1; |
| 2745 EXPECT_LE( | 2747 EXPECT_LE( |
| 2746 extended_sequence_number - last_observed_sequence_number_[ssrc], | 2748 extended_sequence_number - last_observed_sequence_number_[ssrc], |
| 2747 kMaxSequenceNumberGap) | 2749 kMaxSequenceNumberGap) |
| 2748 << "Gap in sequence numbers (" | 2750 << "Gap in sequence numbers (" |
| 2749 << last_observed_sequence_number_[ssrc] << " -> " << sequence_number | 2751 << last_observed_sequence_number_[ssrc] << " -> " << sequence_number |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2873 << "Timed out waiting for all SSRCs to send packets."; | 2875 << "Timed out waiting for all SSRCs to send packets."; |
| 2874 } | 2876 } |
| 2875 | 2877 |
| 2876 send_transport.StopSending(); | 2878 send_transport.StopSending(); |
| 2877 receive_transport.StopSending(); | 2879 receive_transport.StopSending(); |
| 2878 | 2880 |
| 2879 Stop(); | 2881 Stop(); |
| 2880 DestroyStreams(); | 2882 DestroyStreams(); |
| 2881 } | 2883 } |
| 2882 | 2884 |
| 2883 TEST_F(EndToEndTest, DISABLED_RestartingSendStreamPreservesRtpState) { | 2885 TEST_F(EndToEndTest, RestartingSendStreamPreservesRtpState) { |
| 2884 TestRtpStatePreservation(false); | 2886 TestRtpStatePreservation(false); |
| 2885 } | 2887 } |
| 2886 | 2888 |
| 2887 TEST_F(EndToEndTest, RestartingSendStreamPreservesRtpStatesWithRtx) { | 2889 TEST_F(EndToEndTest, RestartingSendStreamPreservesRtpStatesWithRtx) { |
| 2888 TestRtpStatePreservation(true); | 2890 TestRtpStatePreservation(true); |
| 2889 } | 2891 } |
| 2890 | 2892 |
| 2891 TEST_F(EndToEndTest, RespectsNetworkState) { | 2893 TEST_F(EndToEndTest, RespectsNetworkState) { |
| 2892 // TODO(pbos): Remove accepted downtime packets etc. when signaling network | 2894 // TODO(pbos): Remove accepted downtime packets etc. when signaling network |
| 2893 // down blocks until no more packets will be sent. | 2895 // down blocks until no more packets will be sent. |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3191 EXPECT_TRUE(default_receive_config.rtp.rtx.empty()) | 3193 EXPECT_TRUE(default_receive_config.rtp.rtx.empty()) |
| 3192 << "Enabling RTX requires rtpmap: rtx negotiation."; | 3194 << "Enabling RTX requires rtpmap: rtx negotiation."; |
| 3193 EXPECT_TRUE(default_receive_config.rtp.extensions.empty()) | 3195 EXPECT_TRUE(default_receive_config.rtp.extensions.empty()) |
| 3194 << "Enabling RTP extensions require negotiation."; | 3196 << "Enabling RTP extensions require negotiation."; |
| 3195 | 3197 |
| 3196 VerifyEmptyNackConfig(default_receive_config.rtp.nack); | 3198 VerifyEmptyNackConfig(default_receive_config.rtp.nack); |
| 3197 VerifyEmptyFecConfig(default_receive_config.rtp.fec); | 3199 VerifyEmptyFecConfig(default_receive_config.rtp.fec); |
| 3198 } | 3200 } |
| 3199 | 3201 |
| 3200 } // namespace webrtc | 3202 } // namespace webrtc |
| OLD | NEW |