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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 const PacketTime& packet_time) override; | 104 const PacketTime& packet_time) override; |
105 | 105 |
106 // Implements RecoveredPacketReceiver. | 106 // Implements RecoveredPacketReceiver. |
107 bool OnRecoveredPacket(const uint8_t* packet, size_t length) override; | 107 bool OnRecoveredPacket(const uint8_t* packet, size_t length) override; |
108 | 108 |
109 void SetBitrateConfig( | 109 void SetBitrateConfig( |
110 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; | 110 const webrtc::Call::Config::BitrateConfig& bitrate_config) override; |
111 | 111 |
112 void SignalChannelNetworkState(MediaType media, NetworkState state) override; | 112 void SignalChannelNetworkState(MediaType media, NetworkState state) override; |
113 | 113 |
| 114 void OnTransportOverheadChanged(MediaType media, |
| 115 int transport_overhead_per_packet) override; |
| 116 |
114 void OnNetworkRouteChanged(const std::string& transport_name, | 117 void OnNetworkRouteChanged(const std::string& transport_name, |
115 const rtc::NetworkRoute& network_route) override; | 118 const rtc::NetworkRoute& network_route) override; |
116 | 119 |
117 void OnSentPacket(const rtc::SentPacket& sent_packet) override; | 120 void OnSentPacket(const rtc::SentPacket& sent_packet) override; |
118 | 121 |
119 // Implements BitrateObserver. | 122 // Implements BitrateObserver. |
120 void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, | 123 void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, |
121 int64_t rtt_ms) override; | 124 int64_t rtt_ms) override; |
122 | 125 |
123 // Implements BitrateAllocator::LimitObserver. | 126 // Implements BitrateAllocator::LimitObserver. |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 ReadLockScoped read_lock(*receive_crit_); | 732 ReadLockScoped read_lock(*receive_crit_); |
730 for (auto& kv : audio_receive_ssrcs_) { | 733 for (auto& kv : audio_receive_ssrcs_) { |
731 kv.second->SignalNetworkState(audio_network_state_); | 734 kv.second->SignalNetworkState(audio_network_state_); |
732 } | 735 } |
733 for (auto& kv : video_receive_ssrcs_) { | 736 for (auto& kv : video_receive_ssrcs_) { |
734 kv.second->SignalNetworkState(video_network_state_); | 737 kv.second->SignalNetworkState(video_network_state_); |
735 } | 738 } |
736 } | 739 } |
737 } | 740 } |
738 | 741 |
| 742 void Call::OnTransportOverheadChanged(MediaType media, |
| 743 int transport_overhead_per_packet) { |
| 744 switch (media) { |
| 745 case MediaType::AUDIO: { |
| 746 ReadLockScoped read_lock(*send_crit_); |
| 747 for (auto& kv : audio_send_ssrcs_) { |
| 748 kv.second->SetTransportOverhead(transport_overhead_per_packet); |
| 749 } |
| 750 break; |
| 751 } |
| 752 case MediaType::VIDEO: { |
| 753 ReadLockScoped read_lock(*send_crit_); |
| 754 for (auto& kv : video_send_ssrcs_) { |
| 755 kv.second->SetTransportOverhead(transport_overhead_per_packet); |
| 756 } |
| 757 break; |
| 758 } |
| 759 case MediaType::ANY: |
| 760 case MediaType::DATA: |
| 761 RTC_NOTREACHED(); |
| 762 break; |
| 763 } |
| 764 } |
| 765 |
739 // TODO(honghaiz): Add tests for this method. | 766 // TODO(honghaiz): Add tests for this method. |
740 void Call::OnNetworkRouteChanged(const std::string& transport_name, | 767 void Call::OnNetworkRouteChanged(const std::string& transport_name, |
741 const rtc::NetworkRoute& network_route) { | 768 const rtc::NetworkRoute& network_route) { |
742 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); | 769 RTC_DCHECK(configuration_thread_checker_.CalledOnValidThread()); |
743 // Check if the network route is connected. | 770 // Check if the network route is connected. |
744 if (!network_route.connected) { | 771 if (!network_route.connected) { |
745 LOG(LS_INFO) << "Transport " << transport_name << " is disconnected"; | 772 LOG(LS_INFO) << "Transport " << transport_name << " is disconnected"; |
746 // TODO(honghaiz): Perhaps handle this in SignalChannelNetworkState and | 773 // TODO(honghaiz): Perhaps handle this in SignalChannelNetworkState and |
747 // consider merging these two methods. | 774 // consider merging these two methods. |
748 return; | 775 return; |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 1064 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
1038 ReadLockScoped read_lock(*receive_crit_); | 1065 ReadLockScoped read_lock(*receive_crit_); |
1039 auto it = video_receive_ssrcs_.find(ssrc); | 1066 auto it = video_receive_ssrcs_.find(ssrc); |
1040 if (it == video_receive_ssrcs_.end()) | 1067 if (it == video_receive_ssrcs_.end()) |
1041 return false; | 1068 return false; |
1042 return it->second->OnRecoveredPacket(packet, length); | 1069 return it->second->OnRecoveredPacket(packet, length); |
1043 } | 1070 } |
1044 | 1071 |
1045 } // namespace internal | 1072 } // namespace internal |
1046 } // namespace webrtc | 1073 } // namespace webrtc |
OLD | NEW |