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

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

Issue 1958053002: Revert "Reland of Remove SendPacer from ViEEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased 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_, this, source->bits_per_second()) { 160 pacer_(&clock_,
161 this,
162 source->bits_per_second() / 1000,
163 PacedSender::kDefaultPaceMultiplier * source->bits_per_second() /
164 1000,
165 0) {
161 modules_.push_back(&pacer_); 166 modules_.push_back(&pacer_);
162 } 167 }
163 168
164 PacedVideoSender::~PacedVideoSender() { 169 PacedVideoSender::~PacedVideoSender() {
165 for (Packet* packet : pacer_queue_) 170 for (Packet* packet : pacer_queue_)
166 delete packet; 171 delete packet;
167 for (Packet* packet : queue_) 172 for (Packet* packet : queue_)
168 delete packet; 173 delete packet;
169 } 174 }
170 175
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 303 }
299 304
300 size_t PacedVideoSender::TimeToSendPadding(size_t bytes) { 305 size_t PacedVideoSender::TimeToSendPadding(size_t bytes) {
301 return 0; 306 return 0;
302 } 307 }
303 308
304 void PacedVideoSender::OnNetworkChanged(uint32_t target_bitrate_bps, 309 void PacedVideoSender::OnNetworkChanged(uint32_t target_bitrate_bps,
305 uint8_t fraction_lost, 310 uint8_t fraction_lost,
306 int64_t rtt) { 311 int64_t rtt) {
307 VideoSender::OnNetworkChanged(target_bitrate_bps, fraction_lost, rtt); 312 VideoSender::OnNetworkChanged(target_bitrate_bps, fraction_lost, rtt);
308 pacer_.SetEstimatedBitrate(target_bitrate_bps); 313 pacer_.UpdateBitrate(
314 target_bitrate_bps / 1000,
315 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, 0);
309 } 316 }
310 317
311 const int kNoLimit = std::numeric_limits<int>::max(); 318 const int kNoLimit = std::numeric_limits<int>::max();
312 const int kPacketSizeBytes = 1200; 319 const int kPacketSizeBytes = 1200;
313 320
314 TcpSender::TcpSender(PacketProcessorListener* listener, 321 TcpSender::TcpSender(PacketProcessorListener* listener,
315 int flow_id, 322 int flow_id,
316 int64_t offset_ms) 323 int64_t offset_ms)
317 : TcpSender(listener, flow_id, offset_ms, kNoLimit) { 324 : TcpSender(listener, flow_id, offset_ms, kNoLimit) {
318 } 325 }
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 RecordBitrate(); 485 RecordBitrate();
479 } 486 }
480 487
481 uint32_t TcpSender::TargetBitrateKbps() { 488 uint32_t TcpSender::TargetBitrateKbps() {
482 return bitrate_kbps_; 489 return bitrate_kbps_;
483 } 490 }
484 491
485 } // namespace bwe 492 } // namespace bwe
486 } // namespace testing 493 } // namespace testing
487 } // namespace webrtc 494 } // 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