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

Side by Side Diff: webrtc/video_engine/vie_channel_group.cc

Issue 1413663004: Set pacer target bitrate to max of bwe and bitrate allocation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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/bitrate_controller/include/bitrate_allocator.h ('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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 pacer_->Resume(); 373 pacer_->Resume();
374 } else { 374 } else {
375 pacer_->Pause(); 375 pacer_->Pause();
376 } 376 }
377 } 377 }
378 378
379 // TODO(mflodman): Move this logic out from ChannelGroup. 379 // TODO(mflodman): Move this logic out from ChannelGroup.
380 void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps, 380 void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps,
381 uint8_t fraction_loss, 381 uint8_t fraction_loss,
382 int64_t rtt) { 382 int64_t rtt) {
383 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt); 383 uint32_t allocated_bitrate = bitrate_allocator_->OnNetworkChanged(
stefan-webrtc 2015/10/20 10:13:47 unit on allocated_bitrate
sprang_webrtc 2015/10/21 08:09:16 Done.
384 target_bitrate_bps, fraction_loss, rtt);
385 target_bitrate_bps = std::max(target_bitrate_bps, allocated_bitrate);
mflodman 2015/10/20 10:10:45 And also comment why this is done.
mflodman 2015/10/20 10:10:45 I'd prefer a new variable with another name for th
sprang_webrtc 2015/10/21 08:09:16 Done.
sprang_webrtc 2015/10/21 08:09:16 Done.
384 int pad_up_to_bitrate_bps = 0; 386 int pad_up_to_bitrate_bps = 0;
385 { 387 {
386 rtc::CritScope lock(&encoder_crit_); 388 rtc::CritScope lock(&encoder_crit_);
387 for (const auto& encoder : encoders_) 389 for (const auto& encoder : encoders_)
388 pad_up_to_bitrate_bps += encoder->GetPaddingNeededBps(); 390 pad_up_to_bitrate_bps += encoder->GetPaddingNeededBps();
389 } 391 }
390 pacer_->UpdateBitrate( 392 pacer_->UpdateBitrate(
391 target_bitrate_bps / 1000, 393 target_bitrate_bps / 1000,
392 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, 394 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000,
393 pad_up_to_bitrate_bps / 1000); 395 pad_up_to_bitrate_bps / 1000);
394 } 396 }
395 397
396 void ChannelGroup::OnSentPacket(const rtc::SentPacket& sent_packet) { 398 void ChannelGroup::OnSentPacket(const rtc::SentPacket& sent_packet) {
397 if (transport_feedback_adapter_) { 399 if (transport_feedback_adapter_) {
398 transport_feedback_adapter_->UpdateSendTime(sent_packet.packet_id, 400 transport_feedback_adapter_->UpdateSendTime(sent_packet.packet_id,
399 sent_packet.send_time_ms); 401 sent_packet.send_time_ms);
400 } 402 }
401 } 403 }
402 } // namespace webrtc 404 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/bitrate_controller/include/bitrate_allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698