| 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 2934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2945 << sequence_number << ") too large for SSRC: " << ssrc << "."; | 2945 << sequence_number << ") too large for SSRC: " << ssrc << "."; |
| 2946 seq_numbers->push_back(sequence_number); | 2946 seq_numbers->push_back(sequence_number); |
| 2947 if (seq_numbers->size() >= kMaxSequenceNumberGap) { | 2947 if (seq_numbers->size() >= kMaxSequenceNumberGap) { |
| 2948 seq_numbers->pop_front(); | 2948 seq_numbers->pop_front(); |
| 2949 } | 2949 } |
| 2950 } | 2950 } |
| 2951 | 2951 |
| 2952 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; | 2952 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; |
| 2953 auto timestamp_it = last_observed_timestamp_.find(ssrc); | 2953 auto timestamp_it = last_observed_timestamp_.find(ssrc); |
| 2954 if (timestamp_it == last_observed_timestamp_.end()) { | 2954 if (timestamp_it == last_observed_timestamp_.end()) { |
| 2955 EXPECT_FALSE(only_padding); |
| 2955 last_observed_timestamp_[ssrc] = timestamp; | 2956 last_observed_timestamp_[ssrc] = timestamp; |
| 2956 } else { | 2957 } else { |
| 2957 // Verify timestamps are reasonably close. | 2958 // Verify timestamps are reasonably close. |
| 2958 uint32_t latest_observed = timestamp_it->second; | 2959 uint32_t latest_observed = timestamp_it->second; |
| 2959 // Wraparound handling is unnecessary here as long as an int variable | 2960 // Wraparound handling is unnecessary here as long as an int variable |
| 2960 // is used to store the result. | 2961 // is used to store the result. |
| 2961 int32_t timestamp_gap = timestamp - latest_observed; | 2962 int32_t timestamp_gap = timestamp - latest_observed; |
| 2962 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) | 2963 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) |
| 2963 << "Gap in timestamps (" << latest_observed << " -> " | 2964 << "Gap in timestamps (" << latest_observed << " -> " |
| 2964 << timestamp << ") too large for SSRC: " << ssrc << "."; | 2965 << timestamp << ") too large for SSRC: " << ssrc << "."; |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3540 private: | 3541 private: |
| 3541 bool video_observed_; | 3542 bool video_observed_; |
| 3542 bool audio_observed_; | 3543 bool audio_observed_; |
| 3543 SequenceNumberUnwrapper unwrapper_; | 3544 SequenceNumberUnwrapper unwrapper_; |
| 3544 std::set<int64_t> received_packet_ids_; | 3545 std::set<int64_t> received_packet_ids_; |
| 3545 } test; | 3546 } test; |
| 3546 | 3547 |
| 3547 RunBaseTest(&test); | 3548 RunBaseTest(&test); |
| 3548 } | 3549 } |
| 3549 } // namespace webrtc | 3550 } // namespace webrtc |
| OLD | NEW |