OLD | NEW |
---|---|
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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
848 configuration.bandwidth_callback = rtcp_observer_.get(); | 848 configuration.bandwidth_callback = rtcp_observer_.get(); |
849 if (pacing_enabled_) { | 849 if (pacing_enabled_) { |
850 configuration.paced_sender = rtp_packet_sender_proxy_.get(); | 850 configuration.paced_sender = rtp_packet_sender_proxy_.get(); |
851 configuration.transport_sequence_number_allocator = | 851 configuration.transport_sequence_number_allocator = |
852 seq_num_allocator_proxy_.get(); | 852 seq_num_allocator_proxy_.get(); |
853 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); | 853 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); |
854 } | 854 } |
855 configuration.event_log = event_log; | 855 configuration.event_log = event_log; |
856 | 856 |
857 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); | 857 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); |
858 _rtpRtcpModule->SetSendingMediaStatus(false); | |
the sun
2016/02/17 19:54:54
Now that both voe/vie channels set "sending media"
pbos-webrtc
2016/02/18 13:09:42
Done.
| |
858 | 859 |
859 statistics_proxy_.reset(new StatisticsProxy(_rtpRtcpModule->SSRC())); | 860 statistics_proxy_.reset(new StatisticsProxy(_rtpRtcpModule->SSRC())); |
860 rtp_receive_statistics_->RegisterRtcpStatisticsCallback( | 861 rtp_receive_statistics_->RegisterRtcpStatisticsCallback( |
861 statistics_proxy_.get()); | 862 statistics_proxy_.get()); |
862 | 863 |
863 Config audioproc_config; | 864 Config audioproc_config; |
864 audioproc_config.Set<ExperimentalAgc>(new ExperimentalAgc(false)); | 865 audioproc_config.Set<ExperimentalAgc>(new ExperimentalAgc(false)); |
865 rx_audioproc_.reset(AudioProcessing::Create(audioproc_config)); | 866 rx_audioproc_.reset(AudioProcessing::Create(audioproc_config)); |
866 } | 867 } |
867 | 868 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1129 // Resume the previous sequence number which was reset by StopSend(). | 1130 // Resume the previous sequence number which was reset by StopSend(). |
1130 // This needs to be done before |sending| is set to true. | 1131 // This needs to be done before |sending| is set to true. |
1131 if (send_sequence_number_) | 1132 if (send_sequence_number_) |
1132 SetInitSequenceNumber(send_sequence_number_); | 1133 SetInitSequenceNumber(send_sequence_number_); |
1133 | 1134 |
1134 if (channel_state_.Get().sending) { | 1135 if (channel_state_.Get().sending) { |
1135 return 0; | 1136 return 0; |
1136 } | 1137 } |
1137 channel_state_.SetSending(true); | 1138 channel_state_.SetSending(true); |
1138 | 1139 |
1140 _rtpRtcpModule->SetSendingMediaStatus(true); | |
1139 if (_rtpRtcpModule->SetSendingStatus(true) != 0) { | 1141 if (_rtpRtcpModule->SetSendingStatus(true) != 0) { |
1140 _engineStatisticsPtr->SetLastError( | 1142 _engineStatisticsPtr->SetLastError( |
1141 VE_RTP_RTCP_MODULE_ERROR, kTraceError, | 1143 VE_RTP_RTCP_MODULE_ERROR, kTraceError, |
1142 "StartSend() RTP/RTCP failed to start sending"); | 1144 "StartSend() RTP/RTCP failed to start sending"); |
1145 _rtpRtcpModule->SetSendingMediaStatus(false); | |
1143 rtc::CritScope cs(&_callbackCritSect); | 1146 rtc::CritScope cs(&_callbackCritSect); |
1144 channel_state_.SetSending(false); | 1147 channel_state_.SetSending(false); |
1145 return -1; | 1148 return -1; |
1146 } | 1149 } |
1147 | 1150 |
1148 return 0; | 1151 return 0; |
1149 } | 1152 } |
1150 | 1153 |
1151 int32_t Channel::StopSend() { | 1154 int32_t Channel::StopSend() { |
1152 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1155 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
(...skipping 11 matching lines...) Expand all Loading... | |
1164 // https://code.google.com/p/webrtc/issues/detail?id=2111 . | 1167 // https://code.google.com/p/webrtc/issues/detail?id=2111 . |
1165 send_sequence_number_ = _rtpRtcpModule->SequenceNumber(); | 1168 send_sequence_number_ = _rtpRtcpModule->SequenceNumber(); |
1166 | 1169 |
1167 // Reset sending SSRC and sequence number and triggers direct transmission | 1170 // Reset sending SSRC and sequence number and triggers direct transmission |
1168 // of RTCP BYE | 1171 // of RTCP BYE |
1169 if (_rtpRtcpModule->SetSendingStatus(false) == -1) { | 1172 if (_rtpRtcpModule->SetSendingStatus(false) == -1) { |
1170 _engineStatisticsPtr->SetLastError( | 1173 _engineStatisticsPtr->SetLastError( |
1171 VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, | 1174 VE_RTP_RTCP_MODULE_ERROR, kTraceWarning, |
1172 "StartSend() RTP/RTCP failed to stop sending"); | 1175 "StartSend() RTP/RTCP failed to stop sending"); |
1173 } | 1176 } |
1177 _rtpRtcpModule->SetSendingMediaStatus(false); | |
1174 | 1178 |
1175 return 0; | 1179 return 0; |
1176 } | 1180 } |
1177 | 1181 |
1178 int32_t Channel::StartReceiving() { | 1182 int32_t Channel::StartReceiving() { |
1179 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 1183 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
1180 "Channel::StartReceiving()"); | 1184 "Channel::StartReceiving()"); |
1181 if (channel_state_.Get().receiving) { | 1185 if (channel_state_.Get().receiving) { |
1182 return 0; | 1186 return 0; |
1183 } | 1187 } |
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2592 TransportFeedbackObserver* transport_feedback_observer, | 2596 TransportFeedbackObserver* transport_feedback_observer, |
2593 PacketRouter* packet_router) { | 2597 PacketRouter* packet_router) { |
2594 RTC_DCHECK(rtp_packet_sender); | 2598 RTC_DCHECK(rtp_packet_sender); |
2595 RTC_DCHECK(transport_feedback_observer); | 2599 RTC_DCHECK(transport_feedback_observer); |
2596 RTC_DCHECK(packet_router && !packet_router_); | 2600 RTC_DCHECK(packet_router && !packet_router_); |
2597 feedback_observer_proxy_->SetTransportFeedbackObserver( | 2601 feedback_observer_proxy_->SetTransportFeedbackObserver( |
2598 transport_feedback_observer); | 2602 transport_feedback_observer); |
2599 seq_num_allocator_proxy_->SetSequenceNumberAllocator(packet_router); | 2603 seq_num_allocator_proxy_->SetSequenceNumberAllocator(packet_router); |
2600 rtp_packet_sender_proxy_->SetPacketSender(rtp_packet_sender); | 2604 rtp_packet_sender_proxy_->SetPacketSender(rtp_packet_sender); |
2601 _rtpRtcpModule->SetStorePacketsStatus(true, 600); | 2605 _rtpRtcpModule->SetStorePacketsStatus(true, 600); |
2602 packet_router->AddRtpModule(_rtpRtcpModule.get(), true); | 2606 packet_router->AddRtpModule(_rtpRtcpModule.get()); |
2603 packet_router_ = packet_router; | 2607 packet_router_ = packet_router; |
2604 } | 2608 } |
2605 | 2609 |
2606 void Channel::RegisterReceiverCongestionControlObjects( | 2610 void Channel::RegisterReceiverCongestionControlObjects( |
2607 PacketRouter* packet_router) { | 2611 PacketRouter* packet_router) { |
2608 RTC_DCHECK(packet_router && !packet_router_); | 2612 RTC_DCHECK(packet_router && !packet_router_); |
2609 packet_router->AddRtpModule(_rtpRtcpModule.get(), false); | 2613 packet_router->AddRtpModule(_rtpRtcpModule.get()); |
2610 packet_router_ = packet_router; | 2614 packet_router_ = packet_router; |
2611 } | 2615 } |
2612 | 2616 |
2613 void Channel::ResetCongestionControlObjects() { | 2617 void Channel::ResetCongestionControlObjects() { |
2614 RTC_DCHECK(packet_router_); | 2618 RTC_DCHECK(packet_router_); |
2615 _rtpRtcpModule->SetStorePacketsStatus(false, 600); | 2619 _rtpRtcpModule->SetStorePacketsStatus(false, 600); |
2616 feedback_observer_proxy_->SetTransportFeedbackObserver(nullptr); | 2620 feedback_observer_proxy_->SetTransportFeedbackObserver(nullptr); |
2617 seq_num_allocator_proxy_->SetSequenceNumberAllocator(nullptr); | 2621 seq_num_allocator_proxy_->SetSequenceNumberAllocator(nullptr); |
2618 const bool sender = rtp_packet_sender_proxy_->HasPacketSender(); | 2622 packet_router_->RemoveRtpModule(_rtpRtcpModule.get()); |
the sun
2016/02/17 19:54:54
Remove HasPacketSender() from RtpPacketSenderProxy
pbos-webrtc
2016/02/18 13:09:42
Done.
| |
2619 packet_router_->RemoveRtpModule(_rtpRtcpModule.get(), sender); | |
2620 packet_router_ = nullptr; | 2623 packet_router_ = nullptr; |
2621 rtp_packet_sender_proxy_->SetPacketSender(nullptr); | 2624 rtp_packet_sender_proxy_->SetPacketSender(nullptr); |
2622 } | 2625 } |
2623 | 2626 |
2624 void Channel::SetRTCPStatus(bool enable) { | 2627 void Channel::SetRTCPStatus(bool enable) { |
2625 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2628 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
2626 "Channel::SetRTCPStatus()"); | 2629 "Channel::SetRTCPStatus()"); |
2627 _rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff); | 2630 _rtpRtcpModule->SetRTCPStatus(enable ? RtcpMode::kCompound : RtcpMode::kOff); |
2628 } | 2631 } |
2629 | 2632 |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3650 int64_t min_rtt = 0; | 3653 int64_t min_rtt = 0; |
3651 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3654 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3652 0) { | 3655 0) { |
3653 return 0; | 3656 return 0; |
3654 } | 3657 } |
3655 return rtt; | 3658 return rtt; |
3656 } | 3659 } |
3657 | 3660 |
3658 } // namespace voe | 3661 } // namespace voe |
3659 } // namespace webrtc | 3662 } // namespace webrtc |
OLD | NEW |