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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 std::string transport_name = | 346 std::string transport_name = |
347 _externalTransport ? "external transport" : "WebRtc sockets"; | 347 _externalTransport ? "external transport" : "WebRtc sockets"; |
348 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 348 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
349 "Channel::SendRtcp() transmission using %s failed", | 349 "Channel::SendRtcp() transmission using %s failed", |
350 transport_name.c_str()); | 350 transport_name.c_str()); |
351 return false; | 351 return false; |
352 } | 352 } |
353 return true; | 353 return true; |
354 } | 354 } |
355 | 355 |
356 void Channel::OnPlayTelephoneEvent(uint8_t event, | |
357 uint16_t lengthMs, | |
358 uint8_t volume) { | |
359 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId, _channelId), | |
360 "Channel::OnPlayTelephoneEvent(event=%u, lengthMs=%u," | |
361 " volume=%u)", | |
362 event, lengthMs, volume); | |
363 } | |
364 | |
365 void Channel::OnIncomingSSRCChanged(uint32_t ssrc) { | 356 void Channel::OnIncomingSSRCChanged(uint32_t ssrc) { |
366 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 357 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
367 "Channel::OnIncomingSSRCChanged(SSRC=%d)", ssrc); | 358 "Channel::OnIncomingSSRCChanged(SSRC=%d)", ssrc); |
368 | 359 |
369 // Update ssrc so that NTP for AV sync can be updated. | 360 // Update ssrc so that NTP for AV sync can be updated. |
370 _rtpRtcpModule->SetRemoteSSRC(ssrc); | 361 _rtpRtcpModule->SetRemoteSSRC(ssrc); |
371 } | 362 } |
372 | 363 |
373 void Channel::OnIncomingCSRCChanged(uint32_t CSRC, bool added) { | 364 void Channel::OnIncomingCSRCChanged(uint32_t CSRC, bool added) { |
374 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 365 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 : _instanceId(instanceId), | 715 : _instanceId(instanceId), |
725 _channelId(channelId), | 716 _channelId(channelId), |
726 event_log_(event_log), | 717 event_log_(event_log), |
727 rtp_header_parser_(RtpHeaderParser::Create()), | 718 rtp_header_parser_(RtpHeaderParser::Create()), |
728 rtp_payload_registry_( | 719 rtp_payload_registry_( |
729 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), | 720 new RTPPayloadRegistry(RTPPayloadStrategy::CreateStrategy(true))), |
730 rtp_receive_statistics_( | 721 rtp_receive_statistics_( |
731 ReceiveStatistics::Create(Clock::GetRealTimeClock())), | 722 ReceiveStatistics::Create(Clock::GetRealTimeClock())), |
732 rtp_receiver_( | 723 rtp_receiver_( |
733 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), | 724 RtpReceiver::CreateAudioReceiver(Clock::GetRealTimeClock(), |
734 this, | 725 nullptr, |
735 this, | 726 this, |
736 this, | 727 this, |
737 rtp_payload_registry_.get())), | 728 rtp_payload_registry_.get())), |
738 telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()), | 729 telephone_event_handler_(rtp_receiver_->GetTelephoneEventHandler()), |
739 _outputAudioLevel(), | 730 _outputAudioLevel(), |
740 _externalTransport(false), | 731 _externalTransport(false), |
741 _inputFilePlayerPtr(NULL), | 732 _inputFilePlayerPtr(NULL), |
742 _outputFilePlayerPtr(NULL), | 733 _outputFilePlayerPtr(NULL), |
743 _outputFileRecorderPtr(NULL), | 734 _outputFileRecorderPtr(NULL), |
744 // Avoid conflict with other channels by adding 1024 - 1026, | 735 // Avoid conflict with other channels by adding 1024 - 1026, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 } | 800 } |
810 acm_config.neteq_config.enable_fast_accelerate = | 801 acm_config.neteq_config.enable_fast_accelerate = |
811 config.Get<NetEqFastAccelerate>().enabled; | 802 config.Get<NetEqFastAccelerate>().enabled; |
812 audio_coding_.reset(AudioCodingModule::Create(acm_config)); | 803 audio_coding_.reset(AudioCodingModule::Create(acm_config)); |
813 | 804 |
814 _outputAudioLevel.Clear(); | 805 _outputAudioLevel.Clear(); |
815 | 806 |
816 RtpRtcp::Configuration configuration; | 807 RtpRtcp::Configuration configuration; |
817 configuration.audio = true; | 808 configuration.audio = true; |
818 configuration.outgoing_transport = this; | 809 configuration.outgoing_transport = this; |
819 configuration.audio_messages = this; | |
820 configuration.receive_statistics = rtp_receive_statistics_.get(); | 810 configuration.receive_statistics = rtp_receive_statistics_.get(); |
821 configuration.bandwidth_callback = rtcp_observer_.get(); | 811 configuration.bandwidth_callback = rtcp_observer_.get(); |
822 if (pacing_enabled_) { | 812 if (pacing_enabled_) { |
823 configuration.paced_sender = rtp_packet_sender_proxy_.get(); | 813 configuration.paced_sender = rtp_packet_sender_proxy_.get(); |
824 configuration.transport_sequence_number_allocator = | 814 configuration.transport_sequence_number_allocator = |
825 seq_num_allocator_proxy_.get(); | 815 seq_num_allocator_proxy_.get(); |
826 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); | 816 configuration.transport_feedback_callback = feedback_observer_proxy_.get(); |
827 } | 817 } |
828 configuration.event_log = event_log; | 818 configuration.event_log = event_log; |
829 | 819 |
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2194 int Channel::SendTelephoneEventOutband(int event, int duration_ms) { | 2184 int Channel::SendTelephoneEventOutband(int event, int duration_ms) { |
2195 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), | 2185 WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId), |
2196 "Channel::SendTelephoneEventOutband(...)"); | 2186 "Channel::SendTelephoneEventOutband(...)"); |
2197 RTC_DCHECK_LE(0, event); | 2187 RTC_DCHECK_LE(0, event); |
2198 RTC_DCHECK_GE(255, event); | 2188 RTC_DCHECK_GE(255, event); |
2199 RTC_DCHECK_LE(0, duration_ms); | 2189 RTC_DCHECK_LE(0, duration_ms); |
2200 RTC_DCHECK_GE(65535, duration_ms); | 2190 RTC_DCHECK_GE(65535, duration_ms); |
2201 if (!Sending()) { | 2191 if (!Sending()) { |
2202 return -1; | 2192 return -1; |
2203 } | 2193 } |
2204 | |
2205 if (_rtpRtcpModule->SendTelephoneEventOutband( | 2194 if (_rtpRtcpModule->SendTelephoneEventOutband( |
2206 event, duration_ms, kTelephoneEventAttenuationdB) != 0) { | 2195 event, duration_ms, kTelephoneEventAttenuationdB) != 0) { |
2207 _engineStatisticsPtr->SetLastError( | 2196 _engineStatisticsPtr->SetLastError( |
2208 VE_SEND_DTMF_FAILED, kTraceWarning, | 2197 VE_SEND_DTMF_FAILED, kTraceWarning, |
2209 "SendTelephoneEventOutband() failed to send event"); | 2198 "SendTelephoneEventOutband() failed to send event"); |
2210 return -1; | 2199 return -1; |
2211 } | 2200 } |
2212 return 0; | 2201 return 0; |
2213 } | 2202 } |
2214 | 2203 |
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3540 int64_t min_rtt = 0; | 3529 int64_t min_rtt = 0; |
3541 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != | 3530 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != |
3542 0) { | 3531 0) { |
3543 return 0; | 3532 return 0; |
3544 } | 3533 } |
3545 return rtt; | 3534 return rtt; |
3546 } | 3535 } |
3547 | 3536 |
3548 } // namespace voe | 3537 } // namespace voe |
3549 } // namespace webrtc | 3538 } // namespace webrtc |
OLD | NEW |