Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Side by Side Diff: media/engine/webrtcvoiceengine.cc

Issue 3018523002: Clean out unused methods from VoiceEngine and VoEBase. (Closed)
Patch Set: rebase Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/engine/webrtcvoiceengine.h ('k') | test/mock_voice_engine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 recv_codecs_ = CollectCodecs(decoder_factory_->GetSupportedDecoders()); 283 recv_codecs_ = CollectCodecs(decoder_factory_->GetSupportedDecoders());
284 for (const AudioCodec& codec : recv_codecs_) { 284 for (const AudioCodec& codec : recv_codecs_) {
285 LOG(LS_INFO) << ToString(codec); 285 LOG(LS_INFO) << ToString(codec);
286 } 286 }
287 287
288 channel_config_.enable_voice_pacing = true; 288 channel_config_.enable_voice_pacing = true;
289 289
290 // Temporarily turn logging level up for the Init() call. 290 // Temporarily turn logging level up for the Init() call.
291 webrtc::Trace::SetTraceCallback(this); 291 webrtc::Trace::SetTraceCallback(this);
292 webrtc::Trace::set_level_filter(kElevatedTraceFilter); 292 webrtc::Trace::set_level_filter(kElevatedTraceFilter);
293 LOG(LS_INFO) << webrtc::VoiceEngine::GetVersionString();
294 RTC_CHECK_EQ(0, 293 RTC_CHECK_EQ(0,
295 voe_wrapper_->base()->Init(adm_.get(), apm(), decoder_factory_)); 294 voe_wrapper_->base()->Init(adm_.get(), apm(), decoder_factory_));
296 webrtc::Trace::set_level_filter(kDefaultTraceFilter); 295 webrtc::Trace::set_level_filter(kDefaultTraceFilter);
297 296
298 // No ADM supplied? Get the default one from VoE. 297 // No ADM supplied? Get the default one from VoE.
299 if (!adm_) { 298 if (!adm_) {
300 adm_ = voe_wrapper_->base()->audio_device_module(); 299 adm_ = voe_wrapper_->base()->audio_device_module();
301 } 300 }
302 RTC_DCHECK(adm_); 301 RTC_DCHECK(adm_);
303 302
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 apm_config.residual_echo_detector.enabled = *options.residual_echo_detector; 620 apm_config.residual_echo_detector.enabled = *options.residual_echo_detector;
622 } 621 }
623 622
624 apm()->SetExtraOptions(config); 623 apm()->SetExtraOptions(config);
625 apm()->ApplyConfig(apm_config); 624 apm()->ApplyConfig(apm_config);
626 625
627 if (options.recording_sample_rate) { 626 if (options.recording_sample_rate) {
628 LOG(LS_INFO) << "Recording sample rate is " 627 LOG(LS_INFO) << "Recording sample rate is "
629 << *options.recording_sample_rate; 628 << *options.recording_sample_rate;
630 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) { 629 if (adm()->SetRecordingSampleRate(*options.recording_sample_rate)) {
631 LOG_RTCERR1(SetRecordingSampleRate, *options.recording_sample_rate); 630 LOG(LS_WARNING) << "SetRecordingSampleRate("
631 << *options.recording_sample_rate << ") failed, err="
632 << adm()->LastError();
632 } 633 }
633 } 634 }
634 635
635 if (options.playout_sample_rate) { 636 if (options.playout_sample_rate) {
636 LOG(LS_INFO) << "Playout sample rate is " << *options.playout_sample_rate; 637 LOG(LS_INFO) << "Playout sample rate is " << *options.playout_sample_rate;
637 if (adm()->SetPlayoutSampleRate(*options.playout_sample_rate)) { 638 if (adm()->SetPlayoutSampleRate(*options.playout_sample_rate)) {
638 LOG_RTCERR1(SetPlayoutSampleRate, *options.playout_sample_rate); 639 LOG(LS_WARNING) << "SetPlayoutSampleRate("
640 << *options.playout_sample_rate << ") failed, err="
641 << adm()->LastError();
639 } 642 }
640 } 643 }
641 return true; 644 return true;
642 } 645 }
643 646
644 // TODO(solenberg): Remove, once AudioMonitor is gone. 647 // TODO(solenberg): Remove, once AudioMonitor is gone.
645 int WebRtcVoiceEngine::GetInputLevel() { 648 int WebRtcVoiceEngine::GetInputLevel() {
646 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 649 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
647 int8_t level = transmit_mixer()->AudioLevel(); 650 int8_t level = transmit_mixer()->AudioLevel();
648 RTC_DCHECK_LE(0, level); 651 RTC_DCHECK_LE(0, level);
(...skipping 17 matching lines...) Expand all
666 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri, 669 webrtc::RtpExtension(webrtc::RtpExtension::kAudioLevelUri,
667 webrtc::RtpExtension::kAudioLevelDefaultId)); 670 webrtc::RtpExtension::kAudioLevelDefaultId));
668 if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")) { 671 if (webrtc::field_trial::IsEnabled("WebRTC-Audio-SendSideBwe")) {
669 capabilities.header_extensions.push_back(webrtc::RtpExtension( 672 capabilities.header_extensions.push_back(webrtc::RtpExtension(
670 webrtc::RtpExtension::kTransportSequenceNumberUri, 673 webrtc::RtpExtension::kTransportSequenceNumberUri,
671 webrtc::RtpExtension::kTransportSequenceNumberDefaultId)); 674 webrtc::RtpExtension::kTransportSequenceNumberDefaultId));
672 } 675 }
673 return capabilities; 676 return capabilities;
674 } 677 }
675 678
676 int WebRtcVoiceEngine::GetLastEngineError() {
677 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
678 return voe_wrapper_->error();
679 }
680
681 void WebRtcVoiceEngine::Print(webrtc::TraceLevel level, const char* trace, 679 void WebRtcVoiceEngine::Print(webrtc::TraceLevel level, const char* trace,
682 int length) { 680 int length) {
683 // Note: This callback can happen on any thread! 681 // Note: This callback can happen on any thread!
684 rtc::LoggingSeverity sev = rtc::LS_VERBOSE; 682 rtc::LoggingSeverity sev = rtc::LS_VERBOSE;
685 if (level == webrtc::kTraceError || level == webrtc::kTraceCritical) 683 if (level == webrtc::kTraceError || level == webrtc::kTraceCritical)
686 sev = rtc::LS_ERROR; 684 sev = rtc::LS_ERROR;
687 else if (level == webrtc::kTraceWarning) 685 else if (level == webrtc::kTraceWarning)
688 sev = rtc::LS_WARNING; 686 sev = rtc::LS_WARNING;
689 else if (level == webrtc::kTraceStateInfo || level == webrtc::kTraceInfo) 687 else if (level == webrtc::kTraceStateInfo || level == webrtc::kTraceInfo)
690 sev = rtc::LS_INFO; 688 sev = rtc::LS_INFO;
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 } 1823 }
1826 if (enable && options) { 1824 if (enable && options) {
1827 return SetOptions(*options); 1825 return SetOptions(*options);
1828 } 1826 }
1829 return true; 1827 return true;
1830 } 1828 }
1831 1829
1832 int WebRtcVoiceMediaChannel::CreateVoEChannel() { 1830 int WebRtcVoiceMediaChannel::CreateVoEChannel() {
1833 int id = engine()->CreateVoEChannel(); 1831 int id = engine()->CreateVoEChannel();
1834 if (id == -1) { 1832 if (id == -1) {
1835 LOG_RTCERR0(CreateVoEChannel); 1833 LOG(LS_WARNING) << "CreateVoEChannel() failed.";
1836 return -1; 1834 return -1;
1837 } 1835 }
1838 1836
1839 return id; 1837 return id;
1840 } 1838 }
1841 1839
1842 bool WebRtcVoiceMediaChannel::DeleteVoEChannel(int channel) { 1840 bool WebRtcVoiceMediaChannel::DeleteVoEChannel(int channel) {
1843 if (engine()->voe()->base()->DeleteChannel(channel) == -1) { 1841 if (engine()->voe()->base()->DeleteChannel(channel) == -1) {
1844 LOG_RTCERR1(DeleteChannel, channel); 1842 LOG(LS_WARNING) << "DeleteChannel(" << channel << ") failed.";
1845 return false; 1843 return false;
1846 } 1844 }
1847 return true; 1845 return true;
1848 } 1846 }
1849 1847
1850 bool WebRtcVoiceMediaChannel::AddSendStream(const StreamParams& sp) { 1848 bool WebRtcVoiceMediaChannel::AddSendStream(const StreamParams& sp) {
1851 TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::AddSendStream"); 1849 TRACE_EVENT0("webrtc", "WebRtcVoiceMediaChannel::AddSendStream");
1852 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 1850 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
1853 LOG(LS_INFO) << "AddSendStream: " << sp.ToString(); 1851 LOG(LS_INFO) << "AddSendStream: " << sp.ToString();
1854 1852
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
2377 ssrc); 2375 ssrc);
2378 if (it != unsignaled_recv_ssrcs_.end()) { 2376 if (it != unsignaled_recv_ssrcs_.end()) {
2379 unsignaled_recv_ssrcs_.erase(it); 2377 unsignaled_recv_ssrcs_.erase(it);
2380 return true; 2378 return true;
2381 } 2379 }
2382 return false; 2380 return false;
2383 } 2381 }
2384 } // namespace cricket 2382 } // namespace cricket
2385 2383
2386 #endif // HAVE_WEBRTC_VOICE 2384 #endif // HAVE_WEBRTC_VOICE
OLDNEW
« no previous file with comments | « media/engine/webrtcvoiceengine.h ('k') | test/mock_voice_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698