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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 : WebRtcVoiceEngine(adm, decoder_factory, audio_mixer, new VoEWrapper()) { | 567 : WebRtcVoiceEngine(adm, decoder_factory, audio_mixer, new VoEWrapper()) { |
568 audio_state_ = | 568 audio_state_ = |
569 webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer)); | 569 webrtc::AudioState::Create(MakeAudioStateConfig(voe(), audio_mixer)); |
570 } | 570 } |
571 | 571 |
572 WebRtcVoiceEngine::WebRtcVoiceEngine( | 572 WebRtcVoiceEngine::WebRtcVoiceEngine( |
573 webrtc::AudioDeviceModule* adm, | 573 webrtc::AudioDeviceModule* adm, |
574 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, | 574 const rtc::scoped_refptr<webrtc::AudioDecoderFactory>& decoder_factory, |
575 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, | 575 rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer, |
576 VoEWrapper* voe_wrapper) | 576 VoEWrapper* voe_wrapper) |
577 : adm_(adm), decoder_factory_(decoder_factory), voe_wrapper_(voe_wrapper) { | 577 : worker_queue_("file_writer_task_queue_"), |
| 578 adm_(adm), |
| 579 decoder_factory_(decoder_factory), |
| 580 voe_wrapper_(voe_wrapper) { |
578 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 581 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
579 LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine"; | 582 LOG(LS_INFO) << "WebRtcVoiceEngine::WebRtcVoiceEngine"; |
580 RTC_DCHECK(voe_wrapper); | 583 RTC_DCHECK(voe_wrapper); |
581 RTC_DCHECK(decoder_factory); | 584 RTC_DCHECK(decoder_factory); |
582 | 585 |
583 signal_thread_checker_.DetachFromThread(); | 586 signal_thread_checker_.DetachFromThread(); |
584 | 587 |
585 // Load our audio codec list. | 588 // Load our audio codec list. |
586 LOG(LS_INFO) << "Supported send codecs in order of preference:"; | 589 LOG(LS_INFO) << "Supported send codecs in order of preference:"; |
587 send_codecs_ = WebRtcVoiceCodecs::SupportedSendCodecs(); | 590 send_codecs_ = WebRtcVoiceCodecs::SupportedSendCodecs(); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1001 int64_t max_size_bytes) { | 1004 int64_t max_size_bytes) { |
1002 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1005 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1003 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); | 1006 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); |
1004 if (!aec_dump_file_stream) { | 1007 if (!aec_dump_file_stream) { |
1005 LOG(LS_ERROR) << "Could not open AEC dump file stream."; | 1008 LOG(LS_ERROR) << "Could not open AEC dump file stream."; |
1006 if (!rtc::ClosePlatformFile(file)) | 1009 if (!rtc::ClosePlatformFile(file)) |
1007 LOG(LS_WARNING) << "Could not close file."; | 1010 LOG(LS_WARNING) << "Could not close file."; |
1008 return false; | 1011 return false; |
1009 } | 1012 } |
1010 StopAecDump(); | 1013 StopAecDump(); |
1011 if (apm()->StartDebugRecording(aec_dump_file_stream, max_size_bytes) != | 1014 if (apm()->StartDebugRecording(aec_dump_file_stream, max_size_bytes, |
| 1015 &worker_queue_) != |
1012 webrtc::AudioProcessing::kNoError) { | 1016 webrtc::AudioProcessing::kNoError) { |
1013 LOG_RTCERR0(StartDebugRecording); | 1017 LOG_RTCERR0(StartDebugRecording); |
1014 fclose(aec_dump_file_stream); | 1018 fclose(aec_dump_file_stream); |
1015 return false; | 1019 return false; |
1016 } | 1020 } |
1017 is_dumping_aec_ = true; | 1021 is_dumping_aec_ = true; |
1018 return true; | 1022 return true; |
1019 } | 1023 } |
1020 | 1024 |
1021 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { | 1025 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { |
1022 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1026 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1023 if (!is_dumping_aec_) { | 1027 if (!is_dumping_aec_) { |
1024 // Start dumping AEC when we are not dumping. | 1028 // Start dumping AEC when we are not dumping. |
1025 if (apm()->StartDebugRecording(filename.c_str(), -1) != | 1029 if (apm()->StartDebugRecording(filename.c_str(), -1, &worker_queue_) != |
1026 webrtc::AudioProcessing::kNoError) { | 1030 webrtc::AudioProcessing::kNoError) { |
1027 LOG_RTCERR1(StartDebugRecording, filename.c_str()); | 1031 LOG_RTCERR1(StartDebugRecording, filename.c_str()); |
1028 } else { | 1032 } else { |
1029 is_dumping_aec_ = true; | 1033 is_dumping_aec_ = true; |
1030 } | 1034 } |
1031 } | 1035 } |
1032 } | 1036 } |
1033 | 1037 |
1034 void WebRtcVoiceEngine::StopAecDump() { | 1038 void WebRtcVoiceEngine::StopAecDump() { |
1035 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1039 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 ssrc); | 2652 ssrc); |
2649 if (it != unsignaled_recv_ssrcs_.end()) { | 2653 if (it != unsignaled_recv_ssrcs_.end()) { |
2650 unsignaled_recv_ssrcs_.erase(it); | 2654 unsignaled_recv_ssrcs_.erase(it); |
2651 return true; | 2655 return true; |
2652 } | 2656 } |
2653 return false; | 2657 return false; |
2654 } | 2658 } |
2655 } // namespace cricket | 2659 } // namespace cricket |
2656 | 2660 |
2657 #endif // HAVE_WEBRTC_VOICE | 2661 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |