OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 11 matching lines...) Expand all Loading... |
22 #include "webrtc/base/arraysize.h" | 22 #include "webrtc/base/arraysize.h" |
23 #include "webrtc/base/base64.h" | 23 #include "webrtc/base/base64.h" |
24 #include "webrtc/base/byteorder.h" | 24 #include "webrtc/base/byteorder.h" |
25 #include "webrtc/base/common.h" | 25 #include "webrtc/base/common.h" |
26 #include "webrtc/base/constructormagic.h" | 26 #include "webrtc/base/constructormagic.h" |
27 #include "webrtc/base/helpers.h" | 27 #include "webrtc/base/helpers.h" |
28 #include "webrtc/base/logging.h" | 28 #include "webrtc/base/logging.h" |
29 #include "webrtc/base/stringencode.h" | 29 #include "webrtc/base/stringencode.h" |
30 #include "webrtc/base/stringutils.h" | 30 #include "webrtc/base/stringutils.h" |
31 #include "webrtc/base/trace_event.h" | 31 #include "webrtc/base/trace_event.h" |
32 #include "webrtc/common.h" | |
33 #include "webrtc/media/base/audiosource.h" | 32 #include "webrtc/media/base/audiosource.h" |
34 #include "webrtc/media/base/mediaconstants.h" | 33 #include "webrtc/media/base/mediaconstants.h" |
35 #include "webrtc/media/base/streamparams.h" | 34 #include "webrtc/media/base/streamparams.h" |
36 #include "webrtc/media/engine/payload_type_mapper.h" | 35 #include "webrtc/media/engine/payload_type_mapper.h" |
37 #include "webrtc/media/engine/webrtcmediaengine.h" | 36 #include "webrtc/media/engine/webrtcmediaengine.h" |
38 #include "webrtc/media/engine/webrtcvoe.h" | 37 #include "webrtc/media/engine/webrtcvoe.h" |
39 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" | 38 #include "webrtc/modules/audio_coding/acm2/rent_a_codec.h" |
40 #include "webrtc/modules/audio_processing/include/audio_processing.h" | 39 #include "webrtc/modules/audio_processing/include/audio_processing.h" |
41 #include "webrtc/system_wrappers/include/field_trial.h" | 40 #include "webrtc/system_wrappers/include/field_trial.h" |
42 #include "webrtc/system_wrappers/include/trace.h" | 41 #include "webrtc/system_wrappers/include/trace.h" |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 for (const AudioCodec& codec : send_codecs_) { | 530 for (const AudioCodec& codec : send_codecs_) { |
532 LOG(LS_INFO) << ToString(codec); | 531 LOG(LS_INFO) << ToString(codec); |
533 } | 532 } |
534 | 533 |
535 LOG(LS_INFO) << "Supported recv codecs in order of preference:"; | 534 LOG(LS_INFO) << "Supported recv codecs in order of preference:"; |
536 recv_codecs_ = CollectRecvCodecs(); | 535 recv_codecs_ = CollectRecvCodecs(); |
537 for (const AudioCodec& codec : recv_codecs_) { | 536 for (const AudioCodec& codec : recv_codecs_) { |
538 LOG(LS_INFO) << ToString(codec); | 537 LOG(LS_INFO) << ToString(codec); |
539 } | 538 } |
540 | 539 |
541 voe_config_.Set<webrtc::VoicePacing>(new webrtc::VoicePacing(true)); | 540 channel_config_.enable_voice_pacing = true; |
542 | 541 |
543 // Temporarily turn logging level up for the Init() call. | 542 // Temporarily turn logging level up for the Init() call. |
544 webrtc::Trace::SetTraceCallback(this); | 543 webrtc::Trace::SetTraceCallback(this); |
545 webrtc::Trace::set_level_filter(kElevatedTraceFilter); | 544 webrtc::Trace::set_level_filter(kElevatedTraceFilter); |
546 LOG(LS_INFO) << webrtc::VoiceEngine::GetVersionString(); | 545 LOG(LS_INFO) << webrtc::VoiceEngine::GetVersionString(); |
547 RTC_CHECK_EQ(0, voe_wrapper_->base()->Init(adm_.get(), nullptr, | 546 RTC_CHECK_EQ(0, voe_wrapper_->base()->Init(adm_.get(), nullptr, |
548 decoder_factory_)); | 547 decoder_factory_)); |
549 webrtc::Trace::set_level_filter(kDefaultTraceFilter); | 548 webrtc::Trace::set_level_filter(kDefaultTraceFilter); |
550 | 549 |
551 // No ADM supplied? Get the default one from VoE. | 550 // No ADM supplied? Get the default one from VoE. |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 voep->EnableStereoChannelSwapping(*options.stereo_swapping); | 794 voep->EnableStereoChannelSwapping(*options.stereo_swapping); |
796 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) { | 795 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) { |
797 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping); | 796 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping); |
798 return false; | 797 return false; |
799 } | 798 } |
800 } | 799 } |
801 | 800 |
802 if (options.audio_jitter_buffer_max_packets) { | 801 if (options.audio_jitter_buffer_max_packets) { |
803 LOG(LS_INFO) << "NetEq capacity is " | 802 LOG(LS_INFO) << "NetEq capacity is " |
804 << *options.audio_jitter_buffer_max_packets; | 803 << *options.audio_jitter_buffer_max_packets; |
805 voe_config_.Set<webrtc::NetEqCapacityConfig>( | 804 channel_config_.acm_config.neteq_config.max_packets_in_buffer = |
806 new webrtc::NetEqCapacityConfig( | 805 std::max(20, *options.audio_jitter_buffer_max_packets); |
807 *options.audio_jitter_buffer_max_packets)); | |
808 } | 806 } |
809 | |
810 if (options.audio_jitter_buffer_fast_accelerate) { | 807 if (options.audio_jitter_buffer_fast_accelerate) { |
811 LOG(LS_INFO) << "NetEq fast mode? " | 808 LOG(LS_INFO) << "NetEq fast mode? " |
812 << *options.audio_jitter_buffer_fast_accelerate; | 809 << *options.audio_jitter_buffer_fast_accelerate; |
813 voe_config_.Set<webrtc::NetEqFastAccelerate>( | 810 channel_config_.acm_config.neteq_config.enable_fast_accelerate = |
814 new webrtc::NetEqFastAccelerate( | 811 *options.audio_jitter_buffer_fast_accelerate; |
815 *options.audio_jitter_buffer_fast_accelerate)); | |
816 } | 812 } |
817 | 813 |
818 if (options.typing_detection) { | 814 if (options.typing_detection) { |
819 LOG(LS_INFO) << "Typing detection is enabled? " | 815 LOG(LS_INFO) << "Typing detection is enabled? " |
820 << *options.typing_detection; | 816 << *options.typing_detection; |
821 if (voep->SetTypingDetectionStatus(*options.typing_detection) == -1) { | 817 if (voep->SetTypingDetectionStatus(*options.typing_detection) == -1) { |
822 // In case of error, log the info and continue | 818 // In case of error, log the info and continue |
823 LOG_RTCERR1(SetTypingDetectionStatus, *options.typing_detection); | 819 LOG_RTCERR1(SetTypingDetectionStatus, *options.typing_detection); |
824 } | 820 } |
825 } | 821 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != | 1065 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != |
1070 webrtc::AudioProcessing::kNoError) { | 1066 webrtc::AudioProcessing::kNoError) { |
1071 LOG_RTCERR0(StopDebugRecording); | 1067 LOG_RTCERR0(StopDebugRecording); |
1072 } | 1068 } |
1073 is_dumping_aec_ = false; | 1069 is_dumping_aec_ = false; |
1074 } | 1070 } |
1075 } | 1071 } |
1076 | 1072 |
1077 int WebRtcVoiceEngine::CreateVoEChannel() { | 1073 int WebRtcVoiceEngine::CreateVoEChannel() { |
1078 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1074 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1079 return voe_wrapper_->base()->CreateChannel(voe_config_); | 1075 return voe_wrapper_->base()->CreateChannel(channel_config_); |
1080 } | 1076 } |
1081 | 1077 |
1082 webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() { | 1078 webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() { |
1083 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1079 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1084 RTC_DCHECK(adm_); | 1080 RTC_DCHECK(adm_); |
1085 return adm_; | 1081 return adm_; |
1086 } | 1082 } |
1087 | 1083 |
1088 AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const { | 1084 AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const { |
1089 PayloadTypeMapper mapper; | 1085 PayloadTypeMapper mapper; |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2659 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
2664 const auto it = send_streams_.find(ssrc); | 2660 const auto it = send_streams_.find(ssrc); |
2665 if (it != send_streams_.end()) { | 2661 if (it != send_streams_.end()) { |
2666 return it->second->channel(); | 2662 return it->second->channel(); |
2667 } | 2663 } |
2668 return -1; | 2664 return -1; |
2669 } | 2665 } |
2670 } // namespace cricket | 2666 } // namespace cricket |
2671 | 2667 |
2672 #endif // HAVE_WEBRTC_VOICE | 2668 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |