Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/overuse_detector_unittest.cc

Issue 2126793002: Reset InterArrival if arrival time clock makes a jump. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Cleanup Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 return -1; 90 return -1;
91 } 91 }
92 92
93 void UpdateDetector(uint32_t rtp_timestamp, int64_t receive_time_ms, 93 void UpdateDetector(uint32_t rtp_timestamp, int64_t receive_time_ms,
94 size_t packet_size) { 94 size_t packet_size) {
95 uint32_t timestamp_delta; 95 uint32_t timestamp_delta;
96 int64_t time_delta; 96 int64_t time_delta;
97 int size_delta; 97 int size_delta;
98 if (inter_arrival_->ComputeDeltas(rtp_timestamp, 98 if (inter_arrival_->ComputeDeltas(
99 receive_time_ms, 99 rtp_timestamp, receive_time_ms, receive_time_ms, packet_size,
100 packet_size, 100 &timestamp_delta, &time_delta, &size_delta)) {
101 &timestamp_delta,
102 &time_delta,
103 &size_delta)) {
104 double timestamp_delta_ms = timestamp_delta / 90.0; 101 double timestamp_delta_ms = timestamp_delta / 90.0;
105 overuse_estimator_->Update(time_delta, timestamp_delta_ms, size_delta, 102 overuse_estimator_->Update(time_delta, timestamp_delta_ms, size_delta,
106 overuse_detector_->State()); 103 overuse_detector_->State());
107 overuse_detector_->Detect( 104 overuse_detector_->Detect(
108 overuse_estimator_->offset(), timestamp_delta_ms, 105 overuse_estimator_->offset(), timestamp_delta_ms,
109 overuse_estimator_->num_of_deltas(), receive_time_ms); 106 overuse_estimator_->num_of_deltas(), receive_time_ms);
110 } 107 }
111 } 108 }
112 109
113 int64_t now_ms_; 110 int64_t now_ms_;
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 if (overuse_state == kBwOverusing) { 771 if (overuse_state == kBwOverusing) {
775 overuse_detected = true; 772 overuse_detected = true;
776 } 773 }
777 ++num_deltas; 774 ++num_deltas;
778 now_ms += 5; 775 now_ms += 5;
779 } 776 }
780 EXPECT_TRUE(overuse_detected); 777 EXPECT_TRUE(overuse_detected);
781 } 778 }
782 } // namespace testing 779 } // namespace testing
783 } // namespace webrtc 780 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698