OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |