| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 rtc::CritScope lock(&crit_); | 144 rtc::CritScope lock(&crit_); |
| 145 event_log_ = event_log; | 145 event_log_ = event_log; |
| 146 } | 146 } |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 rtc::CriticalSection crit_; | 149 rtc::CriticalSection crit_; |
| 150 RtcEventLog* event_log_ GUARDED_BY(crit_); | 150 RtcEventLog* event_log_ GUARDED_BY(crit_); |
| 151 RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); | 151 RTC_DISALLOW_COPY_AND_ASSIGN(RtcEventLogProxy); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 class RtcpRttStatsProxy final : public RtcpRttStats { |
| 155 public: |
| 156 RtcpRttStatsProxy() : rtcp_rtt_stats_(nullptr) {} |
| 157 |
| 158 void OnRttUpdate(int64_t rtt) override { |
| 159 rtc::CritScope lock(&crit_); |
| 160 if (rtcp_rtt_stats_) |
| 161 rtcp_rtt_stats_->OnRttUpdate(rtt); |
| 162 } |
| 163 |
| 164 int64_t LastProcessedRtt() const override { |
| 165 rtc::CritScope lock(&crit_); |
| 166 if (!rtcp_rtt_stats_) |
| 167 return 0; |
| 168 return rtcp_rtt_stats_->LastProcessedRtt(); |
| 169 } |
| 170 |
| 171 void SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { |
| 172 rtc::CritScope lock(&crit_); |
| 173 rtcp_rtt_stats_ = rtcp_rtt_stats; |
| 174 } |
| 175 |
| 176 private: |
| 177 rtc::CriticalSection crit_; |
| 178 RtcpRttStats* rtcp_rtt_stats_ GUARDED_BY(crit_); |
| 179 RTC_DISALLOW_COPY_AND_ASSIGN(RtcpRttStatsProxy); |
| 180 }; |
| 181 |
| 154 class TransportFeedbackProxy : public TransportFeedbackObserver { | 182 class TransportFeedbackProxy : public TransportFeedbackObserver { |
| 155 public: | 183 public: |
| 156 TransportFeedbackProxy() : feedback_observer_(nullptr) { | 184 TransportFeedbackProxy() : feedback_observer_(nullptr) { |
| 157 pacer_thread_.DetachFromThread(); | 185 pacer_thread_.DetachFromThread(); |
| 158 network_thread_.DetachFromThread(); | 186 network_thread_.DetachFromThread(); |
| 159 } | 187 } |
| 160 | 188 |
| 161 void SetTransportFeedbackObserver( | 189 void SetTransportFeedbackObserver( |
| 162 TransportFeedbackObserver* feedback_observer) { | 190 TransportFeedbackObserver* feedback_observer) { |
| 163 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 191 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 "Channel::RecordFileEnded() => output file recorder module is" | 855 "Channel::RecordFileEnded() => output file recorder module is" |
| 828 " shutdown"); | 856 " shutdown"); |
| 829 } | 857 } |
| 830 | 858 |
| 831 Channel::Channel(int32_t channelId, | 859 Channel::Channel(int32_t channelId, |
| 832 uint32_t instanceId, | 860 uint32_t instanceId, |
| 833 const VoEBase::ChannelConfig& config) | 861 const VoEBase::ChannelConfig& config) |
| 834 : _instanceId(instanceId), | 862 : _instanceId(instanceId), |
| 835 _channelId(channelId), | 863 _channelId(channelId), |
| 836 event_log_proxy_(new RtcEventLogProxy()), | 864 event_log_proxy_(new RtcEventLogProxy()), |
| 865 rtcp_rtt_stats_proxy_(new RtcpRttStatsProxy()), |
| 837 rtp_header_parser_(RtpHeaderParser::Create()), | 866 rtp_header_parser_(RtpHeaderParser::Create()), |
| 838 rtp_payload_registry_(new RTPPayloadRegistry()), | 867 rtp_payload_registry_(new RTPPayloadRegistry()), |
| 839 rtp_receive_statistics_( | 868 rtp_receive_statistics_( |
| 840 ReceiveStatistics::Create(Clock::GetRealTimeClock())), | 869 ReceiveStatistics::Create(Clock::GetRealTimeClock())), |
| 841 rtp_receiver_( | 870 rtp_receiver_( |
| 842 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), | 871 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), |
| 843 this, | 872 this, |
| 844 this, | 873 this, |
| 845 rtp_payload_registry_.get())), | 874 rtp_payload_registry_.get())), |
| 846 telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()), | 875 telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()), |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 configuration.outgoing_transport = this; | 942 configuration.outgoing_transport = this; |
| 914 configuration.receive_statistics = rtp_receive_statistics_.get(); | 943 configuration.receive_statistics = rtp_receive_statistics_.get(); |
| 915 configuration.bandwidth_callback = rtcp_observer_.get(); | 944 configuration.bandwidth_callback = rtcp_observer_.get(); |
| 916 if (pacing_enabled_) { | 945 if (pacing_enabled_) { |
| 917 configuration.paced_sender = rtp_packet_sender_proxy_.get(); | 946 configuration.paced_sender = rtp_packet_sender_proxy_.get(); |
| 918 configuration.transport_sequence_number_allocator = | 947 configuration.transport_sequence_number_allocator = |
| 919 seq_num_allocator_proxy_.get(); | 948 seq_num_allocator_proxy_.get(); |
| 920 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); | 949 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); |
| 921 } | 950 } |
| 922 configuration.event_log = &(*event_log_proxy_); | 951 configuration.event_log = &(*event_log_proxy_); |
| 952 configuration.rtt_stats = &(*rtcp_rtt_stats_proxy_); |
| 923 configuration.retransmission_rate_limiter = | 953 configuration.retransmission_rate_limiter = |
| 924 retransmission_rate_limiter_.get(); | 954 retransmission_rate_limiter_.get(); |
| 925 | 955 |
| 926 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); | 956 _rtpRtcpModule.reset(RtpRtcp::CreateRtpRtcp(configuration)); |
| 927 _rtpRtcpModule->SetSendingMediaStatus(false); | 957 _rtpRtcpModule->SetSendingMediaStatus(false); |
| 928 | 958 |
| 929 statistics_proxy_.reset(new StatisticsProxy(_rtpRtcpModule->SSRC())); | 959 statistics_proxy_.reset(new StatisticsProxy(_rtpRtcpModule->SSRC())); |
| 930 rtp_receive_statistics_->RegisterRtcpStatisticsCallback( | 960 rtp_receive_statistics_->RegisterRtcpStatisticsCallback( |
| 931 statistics_proxy_.get()); | 961 statistics_proxy_.get()); |
| 932 } | 962 } |
| (...skipping 1909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2842 // Channel ID, disassociate with it. | 2872 // Channel ID, disassociate with it. |
| 2843 ChannelOwner ref(NULL); | 2873 ChannelOwner ref(NULL); |
| 2844 associate_send_channel_ = ref; | 2874 associate_send_channel_ = ref; |
| 2845 } | 2875 } |
| 2846 } | 2876 } |
| 2847 | 2877 |
| 2848 void Channel::SetRtcEventLog(RtcEventLog* event_log) { | 2878 void Channel::SetRtcEventLog(RtcEventLog* event_log) { |
| 2849 event_log_proxy_->SetEventLog(event_log); | 2879 event_log_proxy_->SetEventLog(event_log); |
| 2850 } | 2880 } |
| 2851 | 2881 |
| 2882 void Channel::SetRtcpRttStats(RtcpRttStats* rtcp_rtt_stats) { |
| 2883 rtcp_rtt_stats_proxy_->SetRtcpRttStats(rtcp_rtt_stats); |
| 2884 } |
| 2885 |
| 2852 void Channel::SetTransportOverhead(int transport_overhead_per_packet) { | 2886 void Channel::SetTransportOverhead(int transport_overhead_per_packet) { |
| 2853 _rtpRtcpModule->SetTransportOverhead(transport_overhead_per_packet); | 2887 _rtpRtcpModule->SetTransportOverhead(transport_overhead_per_packet); |
| 2854 } | 2888 } |
| 2855 | 2889 |
| 2856 int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, | 2890 int Channel::RegisterExternalMediaProcessing(ProcessingTypes type, |
| 2857 VoEMediaProcess& processObject) { | 2891 VoEMediaProcess& processObject) { |
| 2858 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2892 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
| 2859 "Channel::RegisterExternalMediaProcessing()"); | 2893 "Channel::RegisterExternalMediaProcessing()"); |
| 2860 | 2894 |
| 2861 rtc::CritScope cs(&_callbackCritSect); | 2895 rtc::CritScope cs(&_callbackCritSect); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3251 int64_t min_rtt = 0; | 3285 int64_t min_rtt = 0; |
| 3252 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3286 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
| 3253 0) { | 3287 0) { |
| 3254 return 0; | 3288 return 0; |
| 3255 } | 3289 } |
| 3256 return rtt; | 3290 return rtt; |
| 3257 } | 3291 } |
| 3258 | 3292 |
| 3259 } // namespace voe | 3293 } // namespace voe |
| 3260 } // namespace webrtc | 3294 } // namespace webrtc |
| OLD | NEW |