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

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

Issue 1757683002: Make the audio channel communicate network state changes to the call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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) 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 padding_needed = prober_->RecommendedPacketSize(); 430 padding_needed = prober_->RecommendedPacketSize();
431 } else { 431 } else {
432 padding_needed = padding_budget_->bytes_remaining(); 432 padding_needed = padding_budget_->bytes_remaining();
433 } 433 }
434 434
435 if (padding_needed > 0) 435 if (padding_needed > 0)
436 SendPadding(static_cast<size_t>(padding_needed)); 436 SendPadding(static_cast<size_t>(padding_needed));
437 } 437 }
438 438
439 bool PacedSender::SendPacket(const paced_sender::Packet& packet) { 439 bool PacedSender::SendPacket(const paced_sender::Packet& packet) {
440 // TODO(holmer): Because of this bug issue 5307 we have to send audio 440 if (paused_)
441 // packets even when the pacer is paused. Here we assume audio packets are
442 // always high priority and that they are the only high priority packets.
443 if (paused_ && packet.priority != kHighPriority)
444 return false; 441 return false;
445 critsect_->Leave(); 442 critsect_->Leave();
446 const bool success = callback_->TimeToSendPacket(packet.ssrc, 443 const bool success = callback_->TimeToSendPacket(packet.ssrc,
447 packet.sequence_number, 444 packet.sequence_number,
448 packet.capture_time_ms, 445 packet.capture_time_ms,
449 packet.retransmission); 446 packet.retransmission);
450 critsect_->Enter(); 447 critsect_->Enter();
451 448
452 // TODO(holmer): High priority packets should only be accounted for if we are 449 // TODO(holmer): High priority packets should only be accounted for if we are
453 // allocating bandwidth for audio. 450 // allocating bandwidth for audio.
(...skipping 17 matching lines...) Expand all
471 media_budget_->UseBudget(bytes_sent); 468 media_budget_->UseBudget(bytes_sent);
472 padding_budget_->UseBudget(bytes_sent); 469 padding_budget_->UseBudget(bytes_sent);
473 } 470 }
474 } 471 }
475 472
476 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) { 473 void PacedSender::UpdateBytesPerInterval(int64_t delta_time_ms) {
477 media_budget_->IncreaseBudget(delta_time_ms); 474 media_budget_->IncreaseBudget(delta_time_ms);
478 padding_budget_->IncreaseBudget(delta_time_ms); 475 padding_budget_->IncreaseBudget(delta_time_ms);
479 } 476 }
480 } // namespace webrtc 477 } // namespace webrtc
OLDNEW
« webrtc/call/call.cc ('K') | « webrtc/media/engine/webrtcvoiceengine_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698