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

Side by Side Diff: webrtc/call/call.cc

Issue 2996643002: BWE allocation strategy
Patch Set: BWE allocation strategy Created 3 years, 4 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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 // Implements RecoveredPacketReceiver. 195 // Implements RecoveredPacketReceiver.
196 void OnRecoveredPacket(const uint8_t* packet, size_t length) override; 196 void OnRecoveredPacket(const uint8_t* packet, size_t length) override;
197 197
198 void SetBitrateConfig( 198 void SetBitrateConfig(
199 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; 199 const webrtc::Call::Config::BitrateConfig& bitrate_config) override;
200 200
201 void SetBitrateConfigMask( 201 void SetBitrateConfigMask(
202 const webrtc::Call::Config::BitrateConfigMask& bitrate_config) override; 202 const webrtc::Call::Config::BitrateConfigMask& bitrate_config) override;
203 203
204 void SetBitrateAllocationStrategy(
205 rtc::BitrateAllocationStrategy* bitrate_allocation_strategy) override;
206
204 void SignalChannelNetworkState(MediaType media, NetworkState state) override; 207 void SignalChannelNetworkState(MediaType media, NetworkState state) override;
205 208
206 void OnTransportOverheadChanged(MediaType media, 209 void OnTransportOverheadChanged(MediaType media,
207 int transport_overhead_per_packet) override; 210 int transport_overhead_per_packet) override;
208 211
209 void OnNetworkRouteChanged(const std::string& transport_name, 212 void OnNetworkRouteChanged(const std::string& transport_name,
210 const rtc::NetworkRoute& network_route) override; 213 const rtc::NetworkRoute& network_route) override;
211 214
212 void OnSentPacket(const rtc::SentPacket& sent_packet) override; 215 void OnSentPacket(const rtc::SentPacket& sent_packet) override;
213 216
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 << updated.max_bitrate_bps << ")"; 985 << updated.max_bitrate_bps << ")";
983 transport_send_->send_side_cc()->SetBweBitrates(updated.min_bitrate_bps, 986 transport_send_->send_side_cc()->SetBweBitrates(updated.min_bitrate_bps,
984 updated.start_bitrate_bps, 987 updated.start_bitrate_bps,
985 updated.max_bitrate_bps); 988 updated.max_bitrate_bps);
986 if (!new_start) { 989 if (!new_start) {
987 updated.start_bitrate_bps = config_.bitrate_config.start_bitrate_bps; 990 updated.start_bitrate_bps = config_.bitrate_config.start_bitrate_bps;
988 } 991 }
989 config_.bitrate_config = updated; 992 config_.bitrate_config = updated;
990 } 993 }
991 994
995 void Call::SetBitrateAllocationStrategy(
996 rtc::BitrateAllocationStrategy* bitrate_allocation_strategy) {
997 if (!worker_queue_.IsCurrent()) {
998 worker_queue_.PostTask([this, bitrate_allocation_strategy] {
999 SetBitrateAllocationStrategy(bitrate_allocation_strategy);
1000 });
1001 return;
1002 }
1003 RTC_DCHECK_RUN_ON(&worker_queue_);
1004 bitrate_allocator_->SetBitrateAllocationStrategy(bitrate_allocation_strategy);
1005 }
1006
992 void Call::SignalChannelNetworkState(MediaType media, NetworkState state) { 1007 void Call::SignalChannelNetworkState(MediaType media, NetworkState state) {
993 RTC_DCHECK_RUN_ON(&configuration_thread_checker_); 1008 RTC_DCHECK_RUN_ON(&configuration_thread_checker_);
994 switch (media) { 1009 switch (media) {
995 case MediaType::AUDIO: 1010 case MediaType::AUDIO:
996 audio_network_state_ = state; 1011 audio_network_state_ = state;
997 break; 1012 break;
998 case MediaType::VIDEO: 1013 case MediaType::VIDEO:
999 video_network_state_ = state; 1014 video_network_state_ = state;
1000 break; 1015 break;
1001 case MediaType::ANY: 1016 case MediaType::ANY:
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1383 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { 1398 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) {
1384 receive_side_cc_.OnReceivedPacket( 1399 receive_side_cc_.OnReceivedPacket(
1385 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), 1400 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(),
1386 header); 1401 header);
1387 } 1402 }
1388 } 1403 }
1389 1404
1390 } // namespace internal 1405 } // namespace internal
1391 1406
1392 } // namespace webrtc 1407 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698