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)); | |
542 | |
543 // Temporarily turn logging level up for the Init() call. | 540 // Temporarily turn logging level up for the Init() call. |
544 webrtc::Trace::SetTraceCallback(this); | 541 webrtc::Trace::SetTraceCallback(this); |
545 webrtc::Trace::set_level_filter(kElevatedTraceFilter); | 542 webrtc::Trace::set_level_filter(kElevatedTraceFilter); |
546 LOG(LS_INFO) << webrtc::VoiceEngine::GetVersionString(); | 543 LOG(LS_INFO) << webrtc::VoiceEngine::GetVersionString(); |
547 RTC_CHECK_EQ(0, voe_wrapper_->base()->Init(adm_.get(), nullptr, | 544 RTC_CHECK_EQ(0, voe_wrapper_->base()->Init(adm_.get(), nullptr, |
548 decoder_factory_)); | 545 decoder_factory_)); |
549 webrtc::Trace::set_level_filter(kDefaultTraceFilter); | 546 webrtc::Trace::set_level_filter(kDefaultTraceFilter); |
550 | 547 |
551 // No ADM supplied? Get the default one from VoE. | 548 // No ADM supplied? Get the default one from VoE. |
552 if (!adm_) { | 549 if (!adm_) { |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 voep->EnableStereoChannelSwapping(*options.stereo_swapping); | 792 voep->EnableStereoChannelSwapping(*options.stereo_swapping); |
796 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) { | 793 if (voep->IsStereoChannelSwappingEnabled() != *options.stereo_swapping) { |
797 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping); | 794 LOG_RTCERR1(EnableStereoChannelSwapping, *options.stereo_swapping); |
798 return false; | 795 return false; |
799 } | 796 } |
800 } | 797 } |
801 | 798 |
802 if (options.audio_jitter_buffer_max_packets) { | 799 if (options.audio_jitter_buffer_max_packets) { |
803 LOG(LS_INFO) << "NetEq capacity is " | 800 LOG(LS_INFO) << "NetEq capacity is " |
804 << *options.audio_jitter_buffer_max_packets; | 801 << *options.audio_jitter_buffer_max_packets; |
805 voe_config_.Set<webrtc::NetEqCapacityConfig>( | 802 acm_config_.neteq_config.max_packets_in_buffer = |
806 new webrtc::NetEqCapacityConfig( | 803 std::max(20, *options.audio_jitter_buffer_max_packets); |
807 *options.audio_jitter_buffer_max_packets)); | |
808 } | 804 } |
809 | |
810 if (options.audio_jitter_buffer_fast_accelerate) { | 805 if (options.audio_jitter_buffer_fast_accelerate) { |
811 LOG(LS_INFO) << "NetEq fast mode? " | 806 LOG(LS_INFO) << "NetEq fast mode? " |
812 << *options.audio_jitter_buffer_fast_accelerate; | 807 << *options.audio_jitter_buffer_fast_accelerate; |
813 voe_config_.Set<webrtc::NetEqFastAccelerate>( | 808 acm_config_.neteq_config.enable_fast_accelerate = |
814 new webrtc::NetEqFastAccelerate( | 809 *options.audio_jitter_buffer_fast_accelerate; |
815 *options.audio_jitter_buffer_fast_accelerate)); | |
816 } | 810 } |
817 | 811 |
818 if (options.typing_detection) { | 812 if (options.typing_detection) { |
819 LOG(LS_INFO) << "Typing detection is enabled? " | 813 LOG(LS_INFO) << "Typing detection is enabled? " |
820 << *options.typing_detection; | 814 << *options.typing_detection; |
821 if (voep->SetTypingDetectionStatus(*options.typing_detection) == -1) { | 815 if (voep->SetTypingDetectionStatus(*options.typing_detection) == -1) { |
822 // In case of error, log the info and continue | 816 // In case of error, log the info and continue |
823 LOG_RTCERR1(SetTypingDetectionStatus, *options.typing_detection); | 817 LOG_RTCERR1(SetTypingDetectionStatus, *options.typing_detection); |
824 } | 818 } |
825 } | 819 } |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != | 1063 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != |
1070 webrtc::AudioProcessing::kNoError) { | 1064 webrtc::AudioProcessing::kNoError) { |
1071 LOG_RTCERR0(StopDebugRecording); | 1065 LOG_RTCERR0(StopDebugRecording); |
1072 } | 1066 } |
1073 is_dumping_aec_ = false; | 1067 is_dumping_aec_ = false; |
1074 } | 1068 } |
1075 } | 1069 } |
1076 | 1070 |
1077 int WebRtcVoiceEngine::CreateVoEChannel() { | 1071 int WebRtcVoiceEngine::CreateVoEChannel() { |
1078 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1072 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1079 return voe_wrapper_->base()->CreateChannel(voe_config_); | 1073 return voe_wrapper_->base()->CreateChannel(acm_config_); |
1080 } | 1074 } |
1081 | 1075 |
1082 webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() { | 1076 webrtc::AudioDeviceModule* WebRtcVoiceEngine::adm() { |
1083 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1077 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1084 RTC_DCHECK(adm_); | 1078 RTC_DCHECK(adm_); |
1085 return adm_; | 1079 return adm_; |
1086 } | 1080 } |
1087 | 1081 |
1088 AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const { | 1082 AudioCodecs WebRtcVoiceEngine::CollectRecvCodecs() const { |
1089 PayloadTypeMapper mapper; | 1083 PayloadTypeMapper mapper; |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2663 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2657 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
2664 const auto it = send_streams_.find(ssrc); | 2658 const auto it = send_streams_.find(ssrc); |
2665 if (it != send_streams_.end()) { | 2659 if (it != send_streams_.end()) { |
2666 return it->second->channel(); | 2660 return it->second->channel(); |
2667 } | 2661 } |
2668 return -1; | 2662 return -1; |
2669 } | 2663 } |
2670 } // namespace cricket | 2664 } // namespace cricket |
2671 | 2665 |
2672 #endif // HAVE_WEBRTC_VOICE | 2666 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |