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

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

Issue 2747123007: Test submission of complete AEC-dump refactoring. (Closed)
Patch Set: Most of Karl's comments addressed. Created 3 years, 8 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
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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 : WebRtcVoiceEngine(adm, decoder_factory, audio_mixer, new VoEWrapper()) { 558 : WebRtcVoiceEngine(adm, decoder_factory, audio_mixer, new VoEWrapper()) {
559 audio_state_ = 559 audio_state_ =
560 webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer)); 560 webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer));
561 } 561 }
562 562
563 WebRtcVoiceEngine::WebRtcVoiceEngine( 563 WebRtcVoiceEngine::WebRtcVoiceEngine(
564 webrtc::AudioDeviceModule* adm, 564 webrtc::AudioDeviceModule* adm,
565 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, 565 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory,
566 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, 566 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
567 VoEWrapper* voe_wrapper) 567 VoEWrapper* voe_wrapper)
568 : adm_(adm), decoder_factory_(decoder_factory), voe_wrapper_(voe_wrapper) { 568 : worker_queue_("file_writer_task_queue_"),
569 adm_(adm),
570 decoder_factory_(decoder_factory),
571 voe_wrapper_(voe_wrapper) {
569 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 572 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
570 LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine"; 573 LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine";
571 RTC_DCHECK(voe_wrapper); 574 RTC_DCHECK(voe_wrapper);
572 RTC_DCHECK(decoder_factory); 575 RTC_DCHECK(decoder_factory);
573 576
574 signal_thread_checker_.DetachFromThread(); 577 signal_thread_checker_.DetachFromThread();
575 578
576 // Load our audio codec list. 579 // Load our audio codec list.
577 LOG(LS_INFO) << "Supported send codecs in order of preference:"; 580 LOG(LS_INFO) << "Supported send codecs in order of preference:";
578 send_codecs_ = WebRtcVoiceCodecs::SupportedSendCodecs(); 581 send_codecs_ = WebRtcVoiceCodecs::SupportedSendCodecs();
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 int64_t max_size_bytes) { 995 int64_t max_size_bytes) {
993 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 996 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
994 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); 997 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file);
995 if (!aec_dump_file_stream) { 998 if (!aec_dump_file_stream) {
996 LOG(LS_ERROR) << "Could not open AEC dump file stream."; 999 LOG(LS_ERROR) << "Could not open AEC dump file stream.";
997 if (!rtc::ClosePlatformFile(file)) 1000 if (!rtc::ClosePlatformFile(file))
998 LOG(LS_WARNING) << "Could not close file."; 1001 LOG(LS_WARNING) << "Could not close file.";
999 return false; 1002 return false;
1000 } 1003 }
1001 StopAecDump(); 1004 StopAecDump();
1002 if (apm()->StartDebugRecording(aec_dump_file_stream, max_size_bytes) != 1005 if (apm()->StartDebugRecording(aec_dump_file_stream, max_size_bytes,
1006 &worker_queue_) !=
1003 webrtc::AudioProcessing::kNoError) { 1007 webrtc::AudioProcessing::kNoError) {
1004 LOG_RTCERR0(StartDebugRecording); 1008 LOG_RTCERR0(StartDebugRecording);
1005 fclose(aec_dump_file_stream); 1009 fclose(aec_dump_file_stream);
1006 return false; 1010 return false;
1007 } 1011 }
1008 is_dumping_aec_ = true; 1012 is_dumping_aec_ = true;
1009 return true; 1013 return true;
1010 } 1014 }
1011 1015
1012 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { 1016 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) {
1013 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 1017 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
1014 if (!is_dumping_aec_) { 1018 if (!is_dumping_aec_) {
1015 // Start dumping AEC when we are not dumping. 1019 // Start dumping AEC when we are not dumping.
1016 if (apm()->StartDebugRecording(filename.c_str(), -1) != 1020 if (apm()->StartDebugRecording(filename.c_str(), -1, &worker_queue_) !=
1017 webrtc::AudioProcessing::kNoError) { 1021 webrtc::AudioProcessing::kNoError) {
1018 LOG_RTCERR1(StartDebugRecording, filename.c_str()); 1022 LOG_RTCERR1(StartDebugRecording, filename.c_str());
1019 } else { 1023 } else {
1020 is_dumping_aec_ = true; 1024 is_dumping_aec_ = true;
1021 } 1025 }
1022 } 1026 }
1023 } 1027 }
1024 1028
1025 void WebRtcVoiceEngine::StopAecDump() { 1029 void WebRtcVoiceEngine::StopAecDump() {
1026 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); 1030 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 ssrc); 2630 ssrc);
2627 if (it != unsignaled_recv_ssrcs_.end()) { 2631 if (it != unsignaled_recv_ssrcs_.end()) {
2628 unsignaled_recv_ssrcs_.erase(it); 2632 unsignaled_recv_ssrcs_.erase(it);
2629 return true; 2633 return true;
2630 } 2634 }
2631 return false; 2635 return false;
2632 } 2636 }
2633 } // namespace cricket 2637 } // namespace cricket
2634 2638
2635 #endif // HAVE_WEBRTC_VOICE 2639 #endif // HAVE_WEBRTC_VOICE
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698