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 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2924 << sequence_number << ") too large for SSRC: " << ssrc << "."; | 2924 << sequence_number << ") too large for SSRC: " << ssrc << "."; |
2925 seq_numbers->push_back(sequence_number); | 2925 seq_numbers->push_back(sequence_number); |
2926 if (seq_numbers->size() >= kMaxSequenceNumberGap) { | 2926 if (seq_numbers->size() >= kMaxSequenceNumberGap) { |
2927 seq_numbers->pop_front(); | 2927 seq_numbers->pop_front(); |
2928 } | 2928 } |
2929 } | 2929 } |
2930 | 2930 |
2931 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; | 2931 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; |
2932 auto timestamp_it = last_observed_timestamp_.find(ssrc); | 2932 auto timestamp_it = last_observed_timestamp_.find(ssrc); |
2933 if (timestamp_it == last_observed_timestamp_.end()) { | 2933 if (timestamp_it == last_observed_timestamp_.end()) { |
| 2934 EXPECT_FALSE(only_padding); |
2934 last_observed_timestamp_[ssrc] = timestamp; | 2935 last_observed_timestamp_[ssrc] = timestamp; |
2935 } else { | 2936 } else { |
2936 // Verify timestamps are reasonably close. | 2937 // Verify timestamps are reasonably close. |
2937 uint32_t latest_observed = timestamp_it->second; | 2938 uint32_t latest_observed = timestamp_it->second; |
2938 // Wraparound handling is unnecessary here as long as an int variable | 2939 // Wraparound handling is unnecessary here as long as an int variable |
2939 // is used to store the result. | 2940 // is used to store the result. |
2940 int32_t timestamp_gap = timestamp - latest_observed; | 2941 int32_t timestamp_gap = timestamp - latest_observed; |
2941 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) | 2942 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) |
2942 << "Gap in timestamps (" << latest_observed << " -> " | 2943 << "Gap in timestamps (" << latest_observed << " -> " |
2943 << timestamp << ") too large for SSRC: " << ssrc << "."; | 2944 << timestamp << ") too large for SSRC: " << ssrc << "."; |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3512 private: | 3513 private: |
3513 bool video_observed_; | 3514 bool video_observed_; |
3514 bool audio_observed_; | 3515 bool audio_observed_; |
3515 SequenceNumberUnwrapper unwrapper_; | 3516 SequenceNumberUnwrapper unwrapper_; |
3516 std::set<int64_t> received_packet_ids_; | 3517 std::set<int64_t> received_packet_ids_; |
3517 } test; | 3518 } test; |
3518 | 3519 |
3519 RunBaseTest(&test); | 3520 RunBaseTest(&test); |
3520 } | 3521 } |
3521 } // namespace webrtc | 3522 } // namespace webrtc |
OLD | NEW |