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

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

Issue 1688703002: Prevent busy-looping PacedSender on small packets. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove packet_size_last_send_ = 0 and rename constant Created 4 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 | « webrtc/modules/pacing/bitrate_prober_unittest.cc ('k') | 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 void PacedSender::InsertPacket(RtpPacketSender::Priority priority, 316 void PacedSender::InsertPacket(RtpPacketSender::Priority priority,
317 uint32_t ssrc, 317 uint32_t ssrc,
318 uint16_t sequence_number, 318 uint16_t sequence_number,
319 int64_t capture_time_ms, 319 int64_t capture_time_ms,
320 size_t bytes, 320 size_t bytes,
321 bool retransmission) { 321 bool retransmission) {
322 CriticalSectionScoped cs(critsect_.get()); 322 CriticalSectionScoped cs(critsect_.get());
323 323
324 if (probing_enabled_ && !prober_->IsProbing()) 324 if (probing_enabled_ && !prober_->IsProbing())
325 prober_->SetEnabled(true); 325 prober_->SetEnabled(true);
326 prober_->MaybeInitializeProbe(bitrate_bps_); 326 int64_t now_ms = clock_->TimeInMilliseconds();
327 prober_->OnIncomingPacket(bitrate_bps_, bytes, now_ms);
327 328
328 int64_t now_ms = clock_->TimeInMilliseconds();
329 if (capture_time_ms < 0) 329 if (capture_time_ms < 0)
330 capture_time_ms = now_ms; 330 capture_time_ms = now_ms;
331 331
332 packets_->Push(paced_sender::Packet(priority, ssrc, sequence_number, 332 packets_->Push(paced_sender::Packet(priority, ssrc, sequence_number,
333 capture_time_ms, now_ms, bytes, 333 capture_time_ms, now_ms, bytes,
334 retransmission, packet_counter_++)); 334 retransmission, packet_counter_++));
335 } 335 }
336 336
337 int64_t PacedSender::ExpectedQueueTimeMs() const { 337 int64_t PacedSender::ExpectedQueueTimeMs() const {
338 CriticalSectionScoped cs(critsect_.get()); 338 CriticalSectionScoped cs(critsect_.get());
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 media_budget_->UseBudget(bytes_sent); 472 media_budget_->UseBudget(bytes_sent);
473 padding_budget_->UseBudget(bytes_sent); 473 padding_budget_->UseBudget(bytes_sent);
474 } 474 }
475 } 475 }
476 476
477 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { 477 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) {
478 media_budget_->IncreaseBudget(delta_time_ms); 478 media_budget_->IncreaseBudget(delta_time_ms);
479 padding_budget_->IncreaseBudget(delta_time_ms); 479 padding_budget_->IncreaseBudget(delta_time_ms);
480 } 480 }
481 } // namespace webrtc 481 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/pacing/bitrate_prober_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698