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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/test/packet_sender.cc

Issue 3009363002: Only use BBRs pacer if the unit test is running BBR. (Closed)
Patch Set: Created 3 years, 3 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 uint32_t VideoSender::TargetBitrateKbps() { 154 uint32_t VideoSender::TargetBitrateKbps() {
155 return (source_->bits_per_second() + 500) / 1000; 155 return (source_->bits_per_second() + 500) / 1000;
156 } 156 }
157 157
158 PacedVideoSender::PacedVideoSender(PacketProcessorListener* listener, 158 PacedVideoSender::PacedVideoSender(PacketProcessorListener* listener,
159 VideoSource* source, 159 VideoSource* source,
160 BandwidthEstimatorType estimator) 160 BandwidthEstimatorType estimator)
161 : VideoSender(listener, source, estimator), 161 : VideoSender(listener, source, estimator),
162 // Ugly hack to use BBR's pacer. 162 pacer_(
163 // TODO(gnish): Make pacer choice dependant on the algorithm being used. 163 estimator == kBbrEstimator
164 pacer_(new BbrPacedSender(&clock_, this, nullptr)) { 164 ? static_cast<Pacer*>(new BbrPacedSender(&clock_, this, nullptr))
165 : static_cast<Pacer*>(new PacedSender(&clock_, this, nullptr))) {
165 modules_.push_back(pacer_.get()); 166 modules_.push_back(pacer_.get());
166 pacer_->SetEstimatedBitrate(source->bits_per_second()); 167 pacer_->SetEstimatedBitrate(source->bits_per_second());
167 } 168 }
168 169
169 PacedVideoSender::~PacedVideoSender() { 170 PacedVideoSender::~PacedVideoSender() {
170 for (Packet* packet : pacer_queue_) 171 for (Packet* packet : pacer_queue_)
171 delete packet; 172 delete packet;
172 for (Packet* packet : queue_) 173 for (Packet* packet : queue_)
173 delete packet; 174 delete packet;
174 } 175 }
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 RecordBitrate(); 499 RecordBitrate();
499 } 500 }
500 501
501 uint32_t TcpSender::TargetBitrateKbps() { 502 uint32_t TcpSender::TargetBitrateKbps() {
502 return bitrate_kbps_; 503 return bitrate_kbps_;
503 } 504 }
504 505
505 } // namespace bwe 506 } // namespace bwe
506 } // namespace testing 507 } // namespace testing
507 } // namespace webrtc 508 } // 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