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

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

Issue 1947873002: Reland of Remove SendPacer from ViEEncoder (patchset #13 id:240001 of https://codereview.we… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed CongestionController backwards compatibility Created 4 years, 7 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 uint32_t VideoSender::TargetBitrateKbps() { 152 uint32_t VideoSender::TargetBitrateKbps() {
153 return (source_->bits_per_second() + 500) / 1000; 153 return (source_->bits_per_second() + 500) / 1000;
154 } 154 }
155 155
156 PacedVideoSender::PacedVideoSender(PacketProcessorListener* listener, 156 PacedVideoSender::PacedVideoSender(PacketProcessorListener* listener,
157 VideoSource* source, 157 VideoSource* source,
158 BandwidthEstimatorType estimator) 158 BandwidthEstimatorType estimator)
159 : VideoSender(listener, source, estimator), 159 : VideoSender(listener, source, estimator),
160 pacer_(&clock_, 160 pacer_(&clock_, this, source->bits_per_second()) {
161 this,
162 source->bits_per_second() / 1000,
163 PacedSender::kDefaultPaceMultiplier * source->bits_per_second() /
164 1000,
165 0) {
166 modules_.push_back(&pacer_); 161 modules_.push_back(&pacer_);
167 } 162 }
168 163
169 PacedVideoSender::~PacedVideoSender() { 164 PacedVideoSender::~PacedVideoSender() {
170 for (Packet* packet : pacer_queue_) 165 for (Packet* packet : pacer_queue_)
171 delete packet; 166 delete packet;
172 for (Packet* packet : queue_) 167 for (Packet* packet : queue_)
173 delete packet; 168 delete packet;
174 } 169 }
175 170
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 } 298 }
304 299
305 size_t PacedVideoSender::TimeToSendPadding(size_t bytes) { 300 size_t PacedVideoSender::TimeToSendPadding(size_t bytes) {
306 return 0; 301 return 0;
307 } 302 }
308 303
309 void PacedVideoSender::OnNetworkChanged(uint32_t target_bitrate_bps, 304 void PacedVideoSender::OnNetworkChanged(uint32_t target_bitrate_bps,
310 uint8_t fraction_lost, 305 uint8_t fraction_lost,
311 int64_t rtt) { 306 int64_t rtt) {
312 VideoSender::OnNetworkChanged(target_bitrate_bps, fraction_lost, rtt); 307 VideoSender::OnNetworkChanged(target_bitrate_bps, fraction_lost, rtt);
313 pacer_.UpdateBitrate( 308 pacer_.SetEstimatedBitrate(target_bitrate_bps);
314 target_bitrate_bps / 1000,
315 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, 0);
316 } 309 }
317 310
318 const int kNoLimit = std::numeric_limits<int>::max(); 311 const int kNoLimit = std::numeric_limits<int>::max();
319 const int kPacketSizeBytes = 1200; 312 const int kPacketSizeBytes = 1200;
320 313
321 TcpSender::TcpSender(PacketProcessorListener* listener, 314 TcpSender::TcpSender(PacketProcessorListener* listener,
322 int flow_id, 315 int flow_id,
323 int64_t offset_ms) 316 int64_t offset_ms)
324 : TcpSender(listener, flow_id, offset_ms, kNoLimit) { 317 : TcpSender(listener, flow_id, offset_ms, kNoLimit) {
325 } 318 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 RecordBitrate(); 478 RecordBitrate();
486 } 479 }
487 480
488 uint32_t TcpSender::TargetBitrateKbps() { 481 uint32_t TcpSender::TargetBitrateKbps() {
489 return bitrate_kbps_; 482 return bitrate_kbps_;
490 } 483 }
491 484
492 } // namespace bwe 485 } // namespace bwe
493 } // namespace testing 486 } // namespace testing
494 } // namespace webrtc 487 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/test/packet_sender.h ('k') | webrtc/video/encoder_state_feedback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698