OLD | NEW |
---|---|
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 | 90 |
91 namespace internal { | 91 namespace internal { |
92 | 92 |
93 class Call : public webrtc::Call, | 93 class Call : public webrtc::Call, |
94 public PacketReceiver, | 94 public PacketReceiver, |
95 public RecoveredPacketReceiver, | 95 public RecoveredPacketReceiver, |
96 public SendSideCongestionController::Observer, | 96 public SendSideCongestionController::Observer, |
97 public BitrateAllocator::LimitObserver { | 97 public BitrateAllocator::LimitObserver { |
98 public: | 98 public: |
99 Call(const Call::Config& config, | 99 Call(const Call::Config& config, |
100 std::unique_ptr<RtpTransportControllerSend> transport_send); | 100 std::unique_ptr<RtpTransportControllerSendInterface> transport_send); |
101 virtual ~Call(); | 101 virtual ~Call(); |
102 | 102 |
103 // Implements webrtc::Call. | 103 // Implements webrtc::Call. |
104 PacketReceiver* Receiver() override; | 104 PacketReceiver* Receiver() override; |
105 | 105 |
106 webrtc::AudioSendStream* CreateAudioSendStream( | 106 webrtc::AudioSendStream* CreateAudioSendStream( |
107 const webrtc::AudioSendStream::Config& config) override; | 107 const webrtc::AudioSendStream::Config& config) override; |
108 void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override; | 108 void DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) override; |
109 | 109 |
110 webrtc::AudioReceiveStream* CreateAudioReceiveStream( | 110 webrtc::AudioReceiveStream* CreateAudioReceiveStream( |
(...skipping 23 matching lines...) Expand all Loading... | |
134 const uint8_t* packet, | 134 const uint8_t* packet, |
135 size_t length, | 135 size_t length, |
136 const PacketTime& packet_time) override; | 136 const PacketTime& packet_time) override; |
137 | 137 |
138 // Implements RecoveredPacketReceiver. | 138 // Implements RecoveredPacketReceiver. |
139 bool OnRecoveredPacket(const uint8_t* packet, size_t length) override; | 139 bool OnRecoveredPacket(const uint8_t* packet, size_t length) override; |
140 | 140 |
141 void SetBitrateConfig( | 141 void SetBitrateConfig( |
142 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; | 142 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; |
143 | 143 |
144 RTCError SetBitrateConfigMask( | |
145 const webrtc::Call::Config::BitrateConfigMask& bitrate_config) override; | |
146 | |
144 void SignalChannelNetworkState(MediaType media, NetworkState state) override; | 147 void SignalChannelNetworkState(MediaType media, NetworkState state) override; |
145 | 148 |
146 void OnTransportOverheadChanged(MediaType media, | 149 void OnTransportOverheadChanged(MediaType media, |
147 int transport_overhead_per_packet) override; | 150 int transport_overhead_per_packet) override; |
148 | 151 |
149 void OnNetworkRouteChanged(const std::string& transport_name, | 152 void OnNetworkRouteChanged(const std::string& transport_name, |
150 const rtc::NetworkRoute& network_route) override; | 153 const rtc::NetworkRoute& network_route) override; |
151 | 154 |
152 void OnSentPacket(const rtc::SentPacket& sent_packet) override; | 155 void OnSentPacket(const rtc::SentPacket& sent_packet) override; |
153 | 156 |
(...skipping 26 matching lines...) Expand all Loading... | |
180 size_t length, | 183 size_t length, |
181 const PacketTime& packet_time) | 184 const PacketTime& packet_time) |
182 SHARED_LOCKS_REQUIRED(receive_crit_); | 185 SHARED_LOCKS_REQUIRED(receive_crit_); |
183 | 186 |
184 void UpdateSendHistograms(int64_t first_sent_packet_ms) | 187 void UpdateSendHistograms(int64_t first_sent_packet_ms) |
185 EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_); | 188 EXCLUSIVE_LOCKS_REQUIRED(&bitrate_crit_); |
186 void UpdateReceiveHistograms(); | 189 void UpdateReceiveHistograms(); |
187 void UpdateHistograms(); | 190 void UpdateHistograms(); |
188 void UpdateAggregateNetworkState(); | 191 void UpdateAggregateNetworkState(); |
189 | 192 |
193 // Updates the BitrateConfig cached in |config_| by combining | |
194 // |base_bitrate_config_| and |bitrate_config_mask_| and updates the | |
195 // congestion controller if the combined config changed or if | |
196 // |force_update| is true. | |
197 RTCError UpdateCurrentBitrateConfig(bool force_update); | |
198 | |
199 // UpdateCurrentBitrateConfig, but doesn't verify BitrateConfig invariants. | |
200 void UpdateCurrentBitrateConfigUnchecked(); | |
201 | |
190 Clock* const clock_; | 202 Clock* const clock_; |
191 | 203 |
192 const int num_cpu_cores_; | 204 const int num_cpu_cores_; |
193 const std::unique_ptr<ProcessThread> module_process_thread_; | 205 const std::unique_ptr<ProcessThread> module_process_thread_; |
194 const std::unique_ptr<ProcessThread> pacer_thread_; | 206 const std::unique_ptr<ProcessThread> pacer_thread_; |
195 const std::unique_ptr<CallStats> call_stats_; | 207 const std::unique_ptr<CallStats> call_stats_; |
196 const std::unique_ptr<BitrateAllocator> bitrate_allocator_; | 208 const std::unique_ptr<BitrateAllocator> bitrate_allocator_; |
197 Call::Config config_; | 209 Call::Config config_; |
198 rtc::ThreadChecker configuration_thread_checker_; | 210 rtc::ThreadChecker configuration_thread_checker_; |
199 | 211 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
274 std::unique_ptr<RtpTransportControllerSendInterface> transport_send_; | 286 std::unique_ptr<RtpTransportControllerSendInterface> transport_send_; |
275 ReceiveSideCongestionController receive_side_cc_; | 287 ReceiveSideCongestionController receive_side_cc_; |
276 const std::unique_ptr<SendDelayStats> video_send_delay_stats_; | 288 const std::unique_ptr<SendDelayStats> video_send_delay_stats_; |
277 const int64_t start_ms_; | 289 const int64_t start_ms_; |
278 // TODO(perkj): |worker_queue_| is supposed to replace | 290 // TODO(perkj): |worker_queue_| is supposed to replace |
279 // |module_process_thread_|. | 291 // |module_process_thread_|. |
280 // |worker_queue| is defined last to ensure all pending tasks are cancelled | 292 // |worker_queue| is defined last to ensure all pending tasks are cancelled |
281 // and deleted before any other members. | 293 // and deleted before any other members. |
282 rtc::TaskQueue worker_queue_; | 294 rtc::TaskQueue worker_queue_; |
283 | 295 |
296 // The config mask set by SetBitrateConfigMask. | |
297 // 0 <= min <= start <= max | |
298 Config::BitrateConfigMask bitrate_config_mask_; | |
299 | |
300 // The config set by SetBitrateConfig. | |
301 // min >= 0, start != 0, max == -1 || max > 0 | |
302 Config::BitrateConfig base_bitrate_config_; | |
303 | |
284 RTC_DISALLOW_COPY_AND_ASSIGN(Call); | 304 RTC_DISALLOW_COPY_AND_ASSIGN(Call); |
285 }; | 305 }; |
286 } // namespace internal | 306 } // namespace internal |
287 | 307 |
288 std::string Call::Stats::ToString(int64_t time_ms) const { | 308 std::string Call::Stats::ToString(int64_t time_ms) const { |
289 std::stringstream ss; | 309 std::stringstream ss; |
290 ss << "Call stats: " << time_ms << ", {"; | 310 ss << "Call stats: " << time_ms << ", {"; |
291 ss << "send_bw_bps: " << send_bandwidth_bps << ", "; | 311 ss << "send_bw_bps: " << send_bandwidth_bps << ", "; |
292 ss << "recv_bw_bps: " << recv_bandwidth_bps << ", "; | 312 ss << "recv_bw_bps: " << recv_bandwidth_bps << ", "; |
293 ss << "max_pad_bps: " << max_padding_bitrate_bps << ", "; | 313 ss << "max_pad_bps: " << max_padding_bitrate_bps << ", "; |
294 ss << "pacer_delay_ms: " << pacer_delay_ms << ", "; | 314 ss << "pacer_delay_ms: " << pacer_delay_ms << ", "; |
295 ss << "rtt_ms: " << rtt_ms; | 315 ss << "rtt_ms: " << rtt_ms; |
296 ss << '}'; | 316 ss << '}'; |
297 return ss.str(); | 317 return ss.str(); |
298 } | 318 } |
299 | 319 |
300 Call* Call::Create(const Call::Config& config) { | 320 Call* Call::Create(const Call::Config& config) { |
301 return new internal::Call( | 321 return new internal::Call( |
302 config, std::unique_ptr<RtpTransportControllerSend>( | 322 config, std::unique_ptr<RtpTransportControllerSend>( |
303 new RtpTransportControllerSend(Clock::GetRealTimeClock(), | 323 new RtpTransportControllerSend(Clock::GetRealTimeClock(), |
304 config.event_log))); | 324 config.event_log))); |
305 } | 325 } |
306 | 326 |
327 Call* Call::Create( | |
328 const Call::Config& config, | |
329 std::unique_ptr<RtpTransportControllerSendInterface> transport_send) { | |
330 return new internal::Call(config, std::move(transport_send)); | |
331 } | |
332 | |
307 namespace internal { | 333 namespace internal { |
308 | 334 |
309 Call::Call(const Call::Config& config, | 335 Call::Call(const Call::Config& config, |
310 std::unique_ptr<RtpTransportControllerSend> transport_send) | 336 std::unique_ptr<RtpTransportControllerSendInterface> transport_send) |
311 : clock_(Clock::GetRealTimeClock()), | 337 : clock_(Clock::GetRealTimeClock()), |
312 num_cpu_cores_(CpuInfo::DetectNumberOfCores()), | 338 num_cpu_cores_(CpuInfo::DetectNumberOfCores()), |
313 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), | 339 module_process_thread_(ProcessThread::Create("ModuleProcessThread")), |
314 pacer_thread_(ProcessThread::Create("PacerThread")), | 340 pacer_thread_(ProcessThread::Create("PacerThread")), |
315 call_stats_(new CallStats(clock_)), | 341 call_stats_(new CallStats(clock_)), |
316 bitrate_allocator_(new BitrateAllocator(this)), | 342 bitrate_allocator_(new BitrateAllocator(this)), |
317 config_(config), | 343 config_(config), |
318 audio_network_state_(kNetworkDown), | 344 audio_network_state_(kNetworkDown), |
319 video_network_state_(kNetworkDown), | 345 video_network_state_(kNetworkDown), |
320 receive_crit_(RWLockWrapper::CreateRWLock()), | 346 receive_crit_(RWLockWrapper::CreateRWLock()), |
321 send_crit_(RWLockWrapper::CreateRWLock()), | 347 send_crit_(RWLockWrapper::CreateRWLock()), |
322 event_log_(config.event_log), | 348 event_log_(config.event_log), |
323 received_bytes_per_second_counter_(clock_, nullptr, true), | 349 received_bytes_per_second_counter_(clock_, nullptr, true), |
324 received_audio_bytes_per_second_counter_(clock_, nullptr, true), | 350 received_audio_bytes_per_second_counter_(clock_, nullptr, true), |
325 received_video_bytes_per_second_counter_(clock_, nullptr, true), | 351 received_video_bytes_per_second_counter_(clock_, nullptr, true), |
326 received_rtcp_bytes_per_second_counter_(clock_, nullptr, true), | 352 received_rtcp_bytes_per_second_counter_(clock_, nullptr, true), |
327 min_allocated_send_bitrate_bps_(0), | 353 min_allocated_send_bitrate_bps_(0), |
328 configured_max_padding_bitrate_bps_(0), | 354 configured_max_padding_bitrate_bps_(0), |
329 estimated_send_bitrate_kbps_counter_(clock_, nullptr, true), | 355 estimated_send_bitrate_kbps_counter_(clock_, nullptr, true), |
330 pacer_bitrate_kbps_counter_(clock_, nullptr, true), | 356 pacer_bitrate_kbps_counter_(clock_, nullptr, true), |
331 receive_side_cc_(clock_, transport_send->packet_router()), | 357 receive_side_cc_(clock_, transport_send->packet_router()), |
332 video_send_delay_stats_(new SendDelayStats(clock_)), | 358 video_send_delay_stats_(new SendDelayStats(clock_)), |
333 start_ms_(clock_->TimeInMilliseconds()), | 359 start_ms_(clock_->TimeInMilliseconds()), |
334 worker_queue_("call_worker_queue") { | 360 worker_queue_("call_worker_queue"), |
361 base_bitrate_config_(config.bitrate_config) { | |
335 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 362 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
336 RTC_DCHECK(config.event_log != nullptr); | 363 RTC_DCHECK(config.event_log != nullptr); |
337 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); | 364 RTC_DCHECK_GE(config.bitrate_config.min_bitrate_bps, 0); |
338 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, | 365 RTC_DCHECK_GE(config.bitrate_config.start_bitrate_bps, |
339 config.bitrate_config.min_bitrate_bps); | 366 config.bitrate_config.min_bitrate_bps); |
340 if (config.bitrate_config.max_bitrate_bps != -1) { | 367 if (config.bitrate_config.max_bitrate_bps != -1) { |
341 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, | 368 RTC_DCHECK_GE(config.bitrate_config.max_bitrate_bps, |
342 config.bitrate_config.start_bitrate_bps); | 369 config.bitrate_config.start_bitrate_bps); |
343 } | 370 } |
344 Trace::CreateTrace(); | 371 Trace::CreateTrace(); |
345 transport_send->RegisterNetworkObserver(this); | 372 transport_send->send_side_cc()->RegisterNetworkObserver(this); |
346 transport_send_ = std::move(transport_send); | 373 transport_send_ = std::move(transport_send); |
347 transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown); | 374 transport_send_->send_side_cc()->SignalNetworkState(kNetworkDown); |
348 transport_send_->send_side_cc()->SetBweBitrates( | 375 transport_send_->send_side_cc()->SetBweBitrates( |
349 config_.bitrate_config.min_bitrate_bps, | 376 config_.bitrate_config.min_bitrate_bps, |
350 config_.bitrate_config.start_bitrate_bps, | 377 config_.bitrate_config.start_bitrate_bps, |
351 config_.bitrate_config.max_bitrate_bps); | 378 config_.bitrate_config.max_bitrate_bps); |
352 call_stats_->RegisterStatsObserver(&receive_side_cc_); | 379 call_stats_->RegisterStatsObserver(&receive_side_cc_); |
353 call_stats_->RegisterStatsObserver(transport_send_->send_side_cc()); | 380 call_stats_->RegisterStatsObserver(transport_send_->send_side_cc()); |
354 | 381 |
355 module_process_thread_->Start(); | 382 module_process_thread_->Start(); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
849 rtc::CritScope cs(&bitrate_crit_); | 876 rtc::CritScope cs(&bitrate_crit_); |
850 stats.max_padding_bitrate_bps = configured_max_padding_bitrate_bps_; | 877 stats.max_padding_bitrate_bps = configured_max_padding_bitrate_bps_; |
851 } | 878 } |
852 return stats; | 879 return stats; |
853 } | 880 } |
854 | 881 |
855 void Call::SetBitrateConfig( | 882 void Call::SetBitrateConfig( |
856 const webrtc::Call::Config::BitrateConfig& bitrate_config) { | 883 const webrtc::Call::Config::BitrateConfig& bitrate_config) { |
857 TRACE_EVENT0("webrtc", "Call::SetBitrateConfig"); | 884 TRACE_EVENT0("webrtc", "Call::SetBitrateConfig"); |
858 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 885 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
886 | |
859 RTC_DCHECK_GE(bitrate_config.min_bitrate_bps, 0); | 887 RTC_DCHECK_GE(bitrate_config.min_bitrate_bps, 0); |
860 if (bitrate_config.max_bitrate_bps != -1) | 888 RTC_DCHECK_NE(bitrate_config.start_bitrate_bps, 0); |
889 if (bitrate_config.max_bitrate_bps != -1) { | |
861 RTC_DCHECK_GT(bitrate_config.max_bitrate_bps, 0); | 890 RTC_DCHECK_GT(bitrate_config.max_bitrate_bps, 0); |
862 if (config_.bitrate_config.min_bitrate_bps == | 891 } |
863 bitrate_config.min_bitrate_bps && | 892 |
864 (bitrate_config.start_bitrate_bps <= 0 || | 893 const bool same_min = |
865 config_.bitrate_config.start_bitrate_bps == | 894 base_bitrate_config_.min_bitrate_bps == bitrate_config.min_bitrate_bps; |
866 bitrate_config.start_bitrate_bps) && | 895 const bool same_start = base_bitrate_config_.start_bitrate_bps == |
867 config_.bitrate_config.max_bitrate_bps == | 896 bitrate_config.start_bitrate_bps; |
868 bitrate_config.max_bitrate_bps) { | 897 const bool same_max = |
898 base_bitrate_config_.max_bitrate_bps == bitrate_config.max_bitrate_bps; | |
899 // TODO(zstein): s/same_max/bitrate_config.max_bitrate_bps == -1 || same_max/ | |
Taylor Brandstetter
2017/05/05 08:04:32
Can you explain this TODO?
Zach Stein
2017/05/09 00:41:26
I thought that setting max == -1 was intended to m
| |
900 if (same_min && (bitrate_config.start_bitrate_bps <= 0 || same_start) && | |
901 same_max) { | |
869 // Nothing new to set, early abort to avoid encoder reconfigurations. | 902 // Nothing new to set, early abort to avoid encoder reconfigurations. |
870 return; | 903 return; |
871 } | 904 } |
872 config_.bitrate_config.min_bitrate_bps = bitrate_config.min_bitrate_bps; | 905 |
906 base_bitrate_config_.min_bitrate_bps = bitrate_config.min_bitrate_bps; | |
873 // Start bitrate of -1 means we should keep the old bitrate, which there is | 907 // Start bitrate of -1 means we should keep the old bitrate, which there is |
874 // no point in remembering for the future. | 908 // no point in remembering for the future. |
875 if (bitrate_config.start_bitrate_bps > 0) | 909 if (bitrate_config.start_bitrate_bps > 0) { |
876 config_.bitrate_config.start_bitrate_bps = bitrate_config.start_bitrate_bps; | 910 base_bitrate_config_.start_bitrate_bps = bitrate_config.start_bitrate_bps; |
877 config_.bitrate_config.max_bitrate_bps = bitrate_config.max_bitrate_bps; | 911 } |
878 RTC_DCHECK_NE(bitrate_config.start_bitrate_bps, 0); | 912 base_bitrate_config_.max_bitrate_bps = bitrate_config.max_bitrate_bps; |
913 | |
914 UpdateCurrentBitrateConfigUnchecked(); | |
915 } | |
916 | |
917 RTCError Call::SetBitrateConfigMask( | |
918 const webrtc::Call::Config::BitrateConfigMask& mask) { | |
919 TRACE_EVENT0("webrtc", "Call::SetBitrateConfigMask"); | |
920 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | |
921 | |
922 bitrate_config_mask_ = mask; | |
923 | |
924 const bool force_update = static_cast<bool>(mask.start_bitrate_bps); | |
925 | |
926 return UpdateCurrentBitrateConfig(force_update); | |
927 } | |
928 | |
929 Call::Config::BitrateConfig ComputeMasked( | |
930 const Call::Config::BitrateConfig& base, | |
931 const Call::Config::BitrateConfigMask& mask) { | |
932 Call::Config::BitrateConfig masked; | |
933 masked.min_bitrate_bps = mask.min_bitrate_bps.value_or(base.min_bitrate_bps); | |
934 masked.start_bitrate_bps = | |
935 mask.start_bitrate_bps.value_or(base.start_bitrate_bps); | |
936 | |
937 const rtc::Optional<int>& mask_max = mask.max_bitrate_bps; | |
938 const int base_max = base.max_bitrate_bps; | |
939 const bool mask_has_max = static_cast<bool>(mask_max); | |
940 const bool base_has_max = base_max != -1; | |
941 if (mask_has_max && base_has_max) { | |
942 masked.max_bitrate_bps = std::min(*mask_max, base_max); | |
943 } else if (mask_has_max) { | |
944 masked.max_bitrate_bps = *mask_max; | |
945 } else if (base_has_max) { | |
946 masked.max_bitrate_bps = base_max; | |
947 } else { | |
948 masked.max_bitrate_bps = -1; | |
949 } | |
950 | |
951 return masked; | |
952 } | |
953 | |
954 void Call::UpdateCurrentBitrateConfigUnchecked() { | |
955 Config::BitrateConfig masked = | |
956 ComputeMasked(base_bitrate_config_, bitrate_config_mask_); | |
957 | |
958 // We only get here if SetBitrateConfig changed something. | |
959 | |
960 config_.bitrate_config = masked; | |
879 transport_send_->send_side_cc()->SetBweBitrates( | 961 transport_send_->send_side_cc()->SetBweBitrates( |
880 bitrate_config.min_bitrate_bps, bitrate_config.start_bitrate_bps, | 962 masked.min_bitrate_bps, masked.start_bitrate_bps, masked.max_bitrate_bps); |
881 bitrate_config.max_bitrate_bps); | 963 } |
964 | |
965 RTCError Call::UpdateCurrentBitrateConfig(bool force_update) { | |
966 Config::BitrateConfig masked = | |
967 ComputeMasked(base_bitrate_config_, bitrate_config_mask_); | |
968 | |
969 Config::BitrateConfig& current = config_.bitrate_config; | |
970 if (!force_update && masked.min_bitrate_bps == current.min_bitrate_bps && | |
971 masked.start_bitrate_bps == current.start_bitrate_bps && | |
972 masked.max_bitrate_bps == current.max_bitrate_bps) { | |
973 return RTCError::OK(); | |
974 } | |
975 | |
976 RTC_DCHECK_GE(masked.min_bitrate_bps, 0); | |
977 if (masked.start_bitrate_bps > 0 && | |
978 masked.start_bitrate_bps < masked.min_bitrate_bps) { | |
979 LOG_AND_RETURN_ERROR( | |
980 RTCErrorType::INVALID_STATE, | |
981 "effective start_bitrate_bps < effective min_bitrate_bps"); | |
982 } | |
983 if (masked.max_bitrate_bps != -1 && masked.start_bitrate_bps > 0 && | |
984 masked.max_bitrate_bps < masked.start_bitrate_bps) { | |
985 LOG_AND_RETURN_ERROR( | |
986 RTCErrorType::INVALID_STATE, | |
987 "effective max_bitrate_bps < effective start_bitrate_bps"); | |
988 } | |
989 if (masked.max_bitrate_bps != -1 && | |
990 masked.max_bitrate_bps < masked.min_bitrate_bps) { | |
991 LOG_AND_RETURN_ERROR( | |
992 RTCErrorType::INVALID_STATE, | |
993 "effective max_bitrate_bps < effective min_bitrate_bps"); | |
994 } | |
995 | |
996 current = masked; | |
997 transport_send_->send_side_cc()->SetBweBitrates(current.min_bitrate_bps, | |
998 current.start_bitrate_bps, | |
999 current.max_bitrate_bps); | |
1000 return RTCError::OK(); | |
882 } | 1001 } |
883 | 1002 |
884 void Call::SignalChannelNetworkState(MediaType media, NetworkState state) { | 1003 void Call::SignalChannelNetworkState(MediaType media, NetworkState state) { |
885 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 1004 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
886 switch (media) { | 1005 switch (media) { |
887 case MediaType::AUDIO: | 1006 case MediaType::AUDIO: |
888 audio_network_state_ = state; | 1007 audio_network_state_ = state; |
889 break; | 1008 break; |
890 case MediaType::VIDEO: | 1009 case MediaType::VIDEO: |
891 video_network_state_ = state; | 1010 video_network_state_ = state; |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1282 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { | 1401 (use_send_side_bwe && header.extension.hasTransportSequenceNumber)) { |
1283 receive_side_cc_.OnReceivedPacket( | 1402 receive_side_cc_.OnReceivedPacket( |
1284 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), | 1403 packet.arrival_time_ms(), packet.payload_size() + packet.padding_size(), |
1285 header); | 1404 header); |
1286 } | 1405 } |
1287 } | 1406 } |
1288 | 1407 |
1289 } // namespace internal | 1408 } // namespace internal |
1290 | 1409 |
1291 } // namespace webrtc | 1410 } // namespace webrtc |
OLD | NEW |