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 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2923 } | 2923 } |
2924 } | 2924 } |
2925 | 2925 |
2926 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; | 2926 static const int32_t kMaxTimestampGap = kDefaultTimeoutMs * 90; |
2927 auto timestamp_it = last_observed_timestamp_.find(ssrc); | 2927 auto timestamp_it = last_observed_timestamp_.find(ssrc); |
2928 if (timestamp_it == last_observed_timestamp_.end()) { | 2928 if (timestamp_it == last_observed_timestamp_.end()) { |
2929 last_observed_timestamp_[ssrc] = timestamp; | 2929 last_observed_timestamp_[ssrc] = timestamp; |
2930 } else { | 2930 } else { |
2931 // Verify timestamps are reasonably close. | 2931 // Verify timestamps are reasonably close. |
2932 uint32_t latest_observed = timestamp_it->second; | 2932 uint32_t latest_observed = timestamp_it->second; |
2933 int32_t timestamp_gap = rtc::TimeDiff(timestamp, latest_observed); | 2933 int32_t timestamp_gap = rtc::TimeDiff32(timestamp, latest_observed); |
2934 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) | 2934 EXPECT_LE(std::abs(timestamp_gap), kMaxTimestampGap) |
2935 << "Gap in timestamps (" << latest_observed << " -> " | 2935 << "Gap in timestamps (" << latest_observed << " -> " |
2936 << timestamp << ") too large for SSRC: " << ssrc << "."; | 2936 << timestamp << ") too large for SSRC: " << ssrc << "."; |
2937 timestamp_it->second = timestamp; | 2937 timestamp_it->second = timestamp; |
2938 } | 2938 } |
2939 | 2939 |
2940 rtc::CritScope lock(&crit_); | 2940 rtc::CritScope lock(&crit_); |
2941 // Wait for media packets on all ssrcs. | 2941 // Wait for media packets on all ssrcs. |
2942 if (!ssrc_observed_[ssrc] && !only_padding) { | 2942 if (!ssrc_observed_[ssrc] && !only_padding) { |
2943 ssrc_observed_[ssrc] = true; | 2943 ssrc_observed_[ssrc] = true; |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3498 private: | 3498 private: |
3499 bool video_observed_; | 3499 bool video_observed_; |
3500 bool audio_observed_; | 3500 bool audio_observed_; |
3501 SequenceNumberUnwrapper unwrapper_; | 3501 SequenceNumberUnwrapper unwrapper_; |
3502 std::set<int64_t> received_packet_ids_; | 3502 std::set<int64_t> received_packet_ids_; |
3503 } test; | 3503 } test; |
3504 | 3504 |
3505 RunBaseTest(&test); | 3505 RunBaseTest(&test); |
3506 } | 3506 } |
3507 } // namespace webrtc | 3507 } // namespace webrtc |
OLD | NEW |