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

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

Issue 1732863002: Break out pacer thread from CongestionController to increase testability. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 10 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) 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 int64_t now = clock_->TimeInMilliseconds(); 65 int64_t now = clock_->TimeInMilliseconds();
66 int64_t time_until_next = 0; 66 int64_t time_until_next = 0;
67 if (last_process_time_ms_ != -1 && 67 if (last_process_time_ms_ != -1 &&
68 now - last_process_time_ms_ < kDefaultProcessIntervalMs) { 68 now - last_process_time_ms_ < kDefaultProcessIntervalMs) {
69 time_until_next = (last_process_time_ms_ + kDefaultProcessIntervalMs - now); 69 time_until_next = (last_process_time_ms_ + kDefaultProcessIntervalMs - now);
70 } 70 }
71 return time_until_next; 71 return time_until_next;
72 } 72 }
73 73
74 int32_t RemoteEstimatorProxy::Process() { 74 int32_t RemoteEstimatorProxy::Process() {
75 // TODO(sprang): Perhaps we need a dedicated thread here instead?
76
77 if (TimeUntilNextProcess() > 0) 75 if (TimeUntilNextProcess() > 0)
78 return 0; 76 return 0;
79 last_process_time_ms_ = clock_->TimeInMilliseconds(); 77 last_process_time_ms_ = clock_->TimeInMilliseconds();
80 78
81 bool more_to_build = true; 79 bool more_to_build = true;
82 while (more_to_build) { 80 while (more_to_build) {
83 rtcp::TransportFeedback feedback_packet; 81 rtcp::TransportFeedback feedback_packet;
84 if (BuildFeedbackPacket(&feedback_packet)) { 82 if (BuildFeedbackPacket(&feedback_packet)) {
85 RTC_DCHECK(packet_router_ != nullptr); 83 RTC_DCHECK(packet_router_ != nullptr);
86 packet_router_->SendFeedback(&feedback_packet); 84 packet_router_->SendFeedback(&feedback_packet);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // they need to be re-sent after a reordering. Removal will be handled 147 // they need to be re-sent after a reordering. Removal will be handled
150 // by OnPacketArrival once packets are too old. 148 // by OnPacketArrival once packets are too old.
151 } 149 }
152 if (it == packet_arrival_times_.end()) 150 if (it == packet_arrival_times_.end())
153 window_start_seq_ = -1; 151 window_start_seq_ = -1;
154 152
155 return true; 153 return true;
156 } 154 }
157 155
158 } // namespace webrtc 156 } // namespace webrtc
OLDNEW
« webrtc/call/call.cc ('K') | « webrtc/modules/congestion_controller/include/congestion_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698