| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 rtc::CritScope lock(&crit_); | 150 rtc::CritScope lock(&crit_); |
| 151 event_log_ = event_log; | 151 event_log_ = event_log; |
| 152 } | 152 } |
| 153 | 153 |
| 154 private: | 154 private: |
| 155 rtc::CriticalSection crit_; | 155 rtc::CriticalSection crit_; |
| 156 RtcEventLog* event_log_ GUARDED_BY(crit_); | 156 RtcEventLog* event_log_ GUARDED_BY(crit_); |
| 157 RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); | 157 RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 class RtcpRttStatsProxy final : public RtcpRttStats { | |
| 161 public: | |
| 162 RtcpRttStatsProxy() : rtcp_rtt_stats_(nullptr) {} | |
| 163 | |
| 164 void OnRttUpdate(int64_t rtt) override { | |
| 165 rtc::CritScope lock(&crit_); | |
| 166 if (rtcp_rtt_stats_) | |
| 167 rtcp_rtt_stats_->OnRttUpdate(rtt); | |
| 168 } | |
| 169 | |
| 170 int64_t LastProcessedRtt() const override { | |
| 171 rtc::CritScope lock(&crit_); | |
| 172 if (rtcp_rtt_stats_ == nullptr) | |
| 173 return 0; | |
| 174 return rtcp_rtt_stats_->LastProcessedRtt(); | |
| 175 } | |
| 176 | |
| 177 void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { | |
| 178 rtc::CritScope lock(&crit_); | |
| 179 rtcp_rtt_stats_ = rtcp_rtt_stats; | |
| 180 } | |
| 181 | |
| 182 private: | |
| 183 rtc::CriticalSection crit_; | |
| 184 RtcpRttStats* rtcp_rtt_stats_ GUARDED_BY(crit_); | |
| 185 RTC_DISALLOW_COPY_AND_ASSIGN(RtcpRttStatsProxy); | |
| 186 }; | |
| 187 | |
| 188 class TransportFeedbackProxy : public TransportFeedbackObserver { | 160 class TransportFeedbackProxy : public TransportFeedbackObserver { |
| 189 public: | 161 public: |
| 190 TransportFeedbackProxy() : feedback_observer_(nullptr) { | 162 TransportFeedbackProxy() : feedback_observer_(nullptr) { |
| 191 pacer_thread_.DetachFromThread(); | 163 pacer_thread_.DetachFromThread(); |
| 192 network_thread_.DetachFromThread(); | 164 network_thread_.DetachFromThread(); |
| 193 } | 165 } |
| 194 | 166 |
| 195 void SetTransportFeedbackObserver( | 167 void SetTransportFeedbackObserver( |
| 196 TransportFeedbackObserver* feedback_observer) { | 168 TransportFeedbackObserver* feedback_observer) { |
| 197 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 169 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 "Channel::RecordFileEnded() => output file recorder module is" | 808 "Channel::RecordFileEnded() => output file recorder module is" |
| 837 " shutdown"); | 809 " shutdown"); |
| 838 } | 810 } |
| 839 | 811 |
| 840 Channel::Channel(int32_t channelId, | 812 Channel::Channel(int32_t channelId, |
| 841 uint32_t instanceId, | 813 uint32_t instanceId, |
| 842 const VoEBase::ChannelConfig& config) | 814 const VoEBase::ChannelConfig& config) |
| 843 : _instanceId(instanceId), | 815 : _instanceId(instanceId), |
| 844 _channelId(channelId), | 816 _channelId(channelId), |
| 845 event_log_proxy_(new RtcEventLogProxy()), | 817 event_log_proxy_(new RtcEventLogProxy()), |
| 846 rtcp_rtt_stats_proxy_(new RtcpRttStatsProxy()), | |
| 847 rtp_header_parser_(RtpHeaderParser::Create()), | 818 rtp_header_parser_(RtpHeaderParser::Create()), |
| 848 rtp_payload_registry_( | 819 rtp_payload_registry_( |
| 849 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), | 820 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), |
| 850 rtp_receive_statistics_( | 821 rtp_receive_statistics_( |
| 851 ReceiveStatistics::Create(Clock::GetRealTimeClock())), | 822 ReceiveStatistics::Create(Clock::GetRealTimeClock())), |
| 852 rtp_receiver_( | 823 rtp_receiver_( |
| 853 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), | 824 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), |
| 854 this, | 825 this, |
| 855 this, | 826 this, |
| 856 rtp_payload_registry_.get())), | 827 rtp_payload_registry_.get())), |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 configuration.outgoing_transport = this; | 893 configuration.outgoing_transport = this; |
| 923 configuration.receive_statistics = rtp_receive_statistics_.get(); | 894 configuration.receive_statistics = rtp_receive_statistics_.get(); |
| 924 configuration.bandwidth_callback = rtcp_observer_.get(); | 895 configuration.bandwidth_callback = rtcp_observer_.get(); |
| 925 if (pacing_enabled_) { | 896 if (pacing_enabled_) { |
| 926 configuration.paced_sender = rtp_packet_sender_proxy_.get(); | 897 configuration.paced_sender = rtp_packet_sender_proxy_.get(); |
| 927 configuration.transport_sequence_number_allocator = | 898 configuration.transport_sequence_number_allocator = |
| 928 seq_num_allocator_proxy_.get(); | 899 seq_num_allocator_proxy_.get(); |
| 929 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); | 900 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); |
| 930 } | 901 } |
| 931 configuration.event_log = &(*event_log_proxy_); | 902 configuration.event_log = &(*event_log_proxy_); |
| 932 configuration.rtt_stats = &(*rtcp_rtt_stats_proxy_); | |
| 933 configuration.retransmission_rate_limiter = | 903 configuration.retransmission_rate_limiter = |
| 934 retransmission_rate_limiter_.get(); | 904 retransmission_rate_limiter_.get(); |
| 935 | 905 |
| 936 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); | 906 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); |
| 937 _rtpRtcpModule->SetSendingMediaStatus(false); | 907 _rtpRtcpModule->SetSendingMediaStatus(false); |
| 938 | 908 |
| 939 statistics_proxy_.reset(new StatisticsProxy(_rtpRtcpModule->SSRC())); | 909 statistics_proxy_.reset(new StatisticsProxy(_rtpRtcpModule->SSRC())); |
| 940 rtp_receive_statistics_->RegisterRtcpStatisticsCallback( | 910 rtp_receive_statistics_->RegisterRtcpStatisticsCallback( |
| 941 statistics_proxy_.get()); | 911 statistics_proxy_.get()); |
| 942 } | 912 } |
| (...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2834 // Channel ID, disassociate with it. | 2804 // Channel ID, disassociate with it. |
| 2835 ChannelOwner ref(NULL); | 2805 ChannelOwner ref(NULL); |
| 2836 associate_send_channel_ = ref; | 2806 associate_send_channel_ = ref; |
| 2837 } | 2807 } |
| 2838 } | 2808 } |
| 2839 | 2809 |
| 2840 void Channel::SetRtcEventLog(RtcEventLog* event_log) { | 2810 void Channel::SetRtcEventLog(RtcEventLog* event_log) { |
| 2841 event_log_proxy_->SetEventLog(event_log); | 2811 event_log_proxy_->SetEventLog(event_log); |
| 2842 } | 2812 } |
| 2843 | 2813 |
| 2844 void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { | |
| 2845 rtcp_rtt_stats_proxy_->SetRtcpRttStats(rtcp_rtt_stats); | |
| 2846 } | |
| 2847 | |
| 2848 int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, | 2814 int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, |
| 2849 VoEMediaProcess& processObject) { | 2815 VoEMediaProcess& processObject) { |
| 2850 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2816 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 2851 "Channel::RegisterExternalMediaProcessing()"); | 2817 "Channel::RegisterExternalMediaProcessing()"); |
| 2852 | 2818 |
| 2853 rtc::CritScope cs(&_callbackCritSect); | 2819 rtc::CritScope cs(&_callbackCritSect); |
| 2854 | 2820 |
| 2855 if (kPlaybackPerChannel == type) { | 2821 if (kPlaybackPerChannel == type) { |
| 2856 if (_outputExternalMediaCallbackPtr) { | 2822 if (_outputExternalMediaCallbackPtr) { |
| 2857 _engineStatisticsPtr->SetLastError( | 2823 _engineStatisticsPtr->SetLastError( |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3255 int64_t min_rtt = 0; | 3221 int64_t min_rtt = 0; |
| 3256 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3222 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3257 0) { | 3223 0) { |
| 3258 return 0; | 3224 return 0; |
| 3259 } | 3225 } |
| 3260 return rtt; | 3226 return rtt; |
| 3261 } | 3227 } |
| 3262 | 3228 |
| 3263 } // namespace voe | 3229 } // namespace voe |
| 3264 } // namespace webrtc | 3230 } // namespace webrtc |
| OLD | NEW |