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

Side by Side Diff: webrtc/modules/pacing/bitrate_prober.cc

Issue 2664193002: Fix per regression in probing. (Closed)
Patch Set: Created 3 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
« 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 RTC_DCHECK(!clusters_.empty()); 134 RTC_DCHECK(!clusters_.empty());
135 RTC_DCHECK(ProbingState::kActive == probing_state_); 135 RTC_DCHECK(ProbingState::kActive == probing_state_);
136 return clusters_.front().id; 136 return clusters_.front().id;
137 } 137 }
138 138
139 // Probe size is recommended based on the probe bitrate required. We choose 139 // Probe size is recommended based on the probe bitrate required. We choose
140 // a minimum of twice |kMinProbeDeltaMs| interval to allow scheduling to be 140 // a minimum of twice |kMinProbeDeltaMs| interval to allow scheduling to be
141 // feasible. 141 // feasible.
142 size_t BitrateProber::RecommendedMinProbeSize() const { 142 size_t BitrateProber::RecommendedMinProbeSize() const {
143 RTC_DCHECK(!clusters_.empty()); 143 RTC_DCHECK(!clusters_.empty());
144 return clusters_.front().bitrate_bps * 3 * kMinProbeDeltaMs / (8 * 1000); 144 return clusters_.front().bitrate_bps * 2 * kMinProbeDeltaMs / (8 * 1000);
145 } 145 }
146 146
147 void BitrateProber::ProbeSent(int64_t now_ms, size_t bytes) { 147 void BitrateProber::ProbeSent(int64_t now_ms, size_t bytes) {
148 RTC_DCHECK(probing_state_ == ProbingState::kActive); 148 RTC_DCHECK(probing_state_ == ProbingState::kActive);
149 RTC_DCHECK_GT(bytes, 0); 149 RTC_DCHECK_GT(bytes, 0);
150 150
151 if (!clusters_.empty()) { 151 if (!clusters_.empty()) {
152 ProbeCluster* cluster = &clusters_.front(); 152 ProbeCluster* cluster = &clusters_.front();
153 if (cluster->sent_probes == 0) { 153 if (cluster->sent_probes == 0) {
154 RTC_DCHECK_EQ(cluster->time_started_ms, -1); 154 RTC_DCHECK_EQ(cluster->time_started_ms, -1);
(...skipping 17 matching lines...) Expand all
172 172
173 // Compute the time delta from the cluster start to ensure probe bitrate stays 173 // Compute the time delta from the cluster start to ensure probe bitrate stays
174 // close to the target bitrate. Result is in milliseconds. 174 // close to the target bitrate. Result is in milliseconds.
175 int64_t delta_ms = (8000ll * cluster.sent_bytes + cluster.bitrate_bps / 2) / 175 int64_t delta_ms = (8000ll * cluster.sent_bytes + cluster.bitrate_bps / 2) /
176 cluster.bitrate_bps; 176 cluster.bitrate_bps;
177 return cluster.time_started_ms + delta_ms; 177 return cluster.time_started_ms + delta_ms;
178 } 178 }
179 179
180 180
181 } // namespace webrtc 181 } // 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