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

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

Issue 2365293002: Trust that calls to RemoteEstimatorProxy::Process are done at the right frequency. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 int64_t now = clock_->TimeInMilliseconds(); 71 int64_t now = clock_->TimeInMilliseconds();
72 int64_t time_until_next = 0; 72 int64_t time_until_next = 0;
73 if (last_process_time_ms_ != -1 && 73 if (last_process_time_ms_ != -1 &&
74 now - last_process_time_ms_ < kDefaultProcessIntervalMs) { 74 now - last_process_time_ms_ < kDefaultProcessIntervalMs) {
75 time_until_next = (last_process_time_ms_ + kDefaultProcessIntervalMs - now); 75 time_until_next = (last_process_time_ms_ + kDefaultProcessIntervalMs - now);
76 } 76 }
77 return time_until_next; 77 return time_until_next;
78 } 78 }
79 79
80 void RemoteEstimatorProxy::Process() { 80 void RemoteEstimatorProxy::Process() {
81 if (TimeUntilNextProcess() > 0)
82 return;
83 last_process_time_ms_ = clock_->TimeInMilliseconds(); 81 last_process_time_ms_ = clock_->TimeInMilliseconds();
84 82
85 bool more_to_build = true; 83 bool more_to_build = true;
86 while (more_to_build) { 84 while (more_to_build) {
87 rtcp::TransportFeedback feedback_packet; 85 rtcp::TransportFeedback feedback_packet;
88 if (BuildFeedbackPacket(&feedback_packet)) { 86 if (BuildFeedbackPacket(&feedback_packet)) {
89 RTC_DCHECK(packet_router_ != nullptr); 87 RTC_DCHECK(packet_router_ != nullptr);
90 packet_router_->SendFeedback(&feedback_packet); 88 packet_router_->SendFeedback(&feedback_packet);
91 } else { 89 } else {
92 more_to_build = false; 90 more_to_build = false;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // Note: Don't erase items from packet_arrival_times_ after sending, in case 174 // Note: Don't erase items from packet_arrival_times_ after sending, in case
177 // they need to be re-sent after a reordering. Removal will be handled 175 // they need to be re-sent after a reordering. Removal will be handled
178 // by OnPacketArrival once packets are too old. 176 // by OnPacketArrival once packets are too old.
179 window_start_seq_ = it->first + 1; 177 window_start_seq_ = it->first + 1;
180 } 178 }
181 179
182 return true; 180 return true;
183 } 181 }
184 182
185 } // namespace webrtc 183 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698