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

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

Issue 2246403002: CongestionController::SetBweBitrates may now trigger probing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 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) 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 void BitrateProber::OnIncomingPacket(size_t packet_size) { 58 void BitrateProber::OnIncomingPacket(size_t packet_size) {
59 // Don't initialize probing unless we have something large enough to start 59 // Don't initialize probing unless we have something large enough to start
60 // probing. 60 // probing.
61 if (probing_state_ == ProbingState::kInactive && 61 if (probing_state_ == ProbingState::kInactive &&
62 packet_size >= PacedSender::kMinProbePacketSize) { 62 packet_size >= PacedSender::kMinProbePacketSize) {
63 probing_state_ = ProbingState::kActive; 63 probing_state_ = ProbingState::kActive;
64 } 64 }
65 } 65 }
66 66
67 void BitrateProber::ProbeAtBitrate(uint32_t bitrate_bps, int num_packets) { 67 void BitrateProber::ProbeAtBitrate(int bitrate_bps, int num_packets) {
68 ProbeCluster cluster; 68 ProbeCluster cluster;
69 cluster.max_probe_packets = num_packets; 69 cluster.max_probe_packets = num_packets;
70 cluster.probe_bitrate_bps = bitrate_bps; 70 cluster.probe_bitrate_bps = bitrate_bps;
71 cluster.id = next_cluster_id_++; 71 cluster.id = next_cluster_id_++;
72 clusters_.push(cluster); 72 clusters_.push(cluster);
73 LOG(LS_INFO) << "Probe cluster (bitrate:packets): (" 73 LOG(LS_INFO) << "Probe cluster (bitrate:packets): ("
74 << cluster.probe_bitrate_bps << ":" << cluster.max_probe_packets 74 << cluster.probe_bitrate_bps << ":" << cluster.max_probe_packets
75 << ") "; 75 << ") ";
76 if (probing_state_ != ProbingState::kActive) 76 if (probing_state_ != ProbingState::kActive)
77 probing_state_ = ProbingState::kInactive; 77 probing_state_ = ProbingState::kInactive;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 if (!clusters_.empty()) { 155 if (!clusters_.empty()) {
156 ProbeCluster* cluster = &clusters_.front(); 156 ProbeCluster* cluster = &clusters_.front();
157 ++cluster->sent_probe_packets; 157 ++cluster->sent_probe_packets;
158 if (cluster->sent_probe_packets == cluster->max_probe_packets) 158 if (cluster->sent_probe_packets == cluster->max_probe_packets)
159 clusters_.pop(); 159 clusters_.pop();
160 if (clusters_.empty()) 160 if (clusters_.empty())
161 probing_state_ = ProbingState::kSuspended; 161 probing_state_ = ProbingState::kSuspended;
162 } 162 }
163 } 163 }
164 } // namespace webrtc 164 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698