OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 adm_->Release(); | 1009 adm_->Release(); |
1010 adm_ = NULL; | 1010 adm_ = NULL; |
1011 } | 1011 } |
1012 if (adm) { | 1012 if (adm) { |
1013 adm_ = adm; | 1013 adm_ = adm; |
1014 adm_->AddRef(); | 1014 adm_->AddRef(); |
1015 } | 1015 } |
1016 return true; | 1016 return true; |
1017 } | 1017 } |
1018 | 1018 |
1019 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file, | 1019 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file) { |
1020 int64_t max_size_bytes) { | |
1021 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1020 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1022 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); | 1021 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); |
1023 if (!aec_dump_file_stream) { | 1022 if (!aec_dump_file_stream) { |
1024 LOG(LS_ERROR) << "Could not open AEC dump file stream."; | 1023 LOG(LS_ERROR) << "Could not open AEC dump file stream."; |
1025 if (!rtc::ClosePlatformFile(file)) | 1024 if (!rtc::ClosePlatformFile(file)) |
1026 LOG(LS_WARNING) << "Could not close file."; | 1025 LOG(LS_WARNING) << "Could not close file."; |
1027 return false; | 1026 return false; |
1028 } | 1027 } |
1029 StopAecDump(); | 1028 StopAecDump(); |
1030 if (voe_wrapper_->base()->audio_processing()->StartDebugRecording( | 1029 if (voe_wrapper_->processing()->StartDebugRecording(aec_dump_file_stream) != |
1031 aec_dump_file_stream, max_size_bytes) != | |
1032 webrtc::AudioProcessing::kNoError) { | 1030 webrtc::AudioProcessing::kNoError) { |
1033 LOG_RTCERR0(StartDebugRecording); | 1031 LOG_RTCERR0(StartDebugRecording); |
1034 fclose(aec_dump_file_stream); | 1032 fclose(aec_dump_file_stream); |
1035 return false; | 1033 return false; |
1036 } | 1034 } |
1037 is_dumping_aec_ = true; | 1035 is_dumping_aec_ = true; |
1038 return true; | 1036 return true; |
1039 } | 1037 } |
1040 | 1038 |
1041 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { | 1039 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { |
1042 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1040 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1043 if (!is_dumping_aec_) { | 1041 if (!is_dumping_aec_) { |
1044 // Start dumping AEC when we are not dumping. | 1042 // Start dumping AEC when we are not dumping. |
1045 if (voe_wrapper_->base()->audio_processing()->StartDebugRecording( | 1043 if (voe_wrapper_->processing()->StartDebugRecording( |
1046 filename.c_str(), -1) != webrtc::AudioProcessing::kNoError) { | 1044 filename.c_str()) != webrtc::AudioProcessing::kNoError) { |
1047 LOG_RTCERR1(StartDebugRecording, filename.c_str()); | 1045 LOG_RTCERR1(StartDebugRecording, filename.c_str()); |
1048 } else { | 1046 } else { |
1049 is_dumping_aec_ = true; | 1047 is_dumping_aec_ = true; |
1050 } | 1048 } |
1051 } | 1049 } |
1052 } | 1050 } |
1053 | 1051 |
1054 void WebRtcVoiceEngine::StopAecDump() { | 1052 void WebRtcVoiceEngine::StopAecDump() { |
1055 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1053 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1056 if (is_dumping_aec_) { | 1054 if (is_dumping_aec_) { |
1057 // Stop dumping AEC when we are dumping. | 1055 // Stop dumping AEC when we are dumping. |
1058 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != | 1056 if (voe_wrapper_->processing()->StopDebugRecording() != |
1059 webrtc::AudioProcessing::kNoError) { | 1057 webrtc::AudioProcessing::kNoError) { |
1060 LOG_RTCERR0(StopDebugRecording); | 1058 LOG_RTCERR0(StopDebugRecording); |
1061 } | 1059 } |
1062 is_dumping_aec_ = false; | 1060 is_dumping_aec_ = false; |
1063 } | 1061 } |
1064 } | 1062 } |
1065 | 1063 |
1066 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { | 1064 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { |
1067 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1065 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1068 return voe_wrapper_->codec()->GetEventLog()->StartLogging(file); | 1066 return voe_wrapper_->codec()->GetEventLog()->StartLogging(file); |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2507 } | 2505 } |
2508 } else { | 2506 } else { |
2509 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2507 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
2510 engine()->voe()->base()->StopPlayout(channel); | 2508 engine()->voe()->base()->StopPlayout(channel); |
2511 } | 2509 } |
2512 return true; | 2510 return true; |
2513 } | 2511 } |
2514 } // namespace cricket | 2512 } // namespace cricket |
2515 | 2513 |
2516 #endif // HAVE_WEBRTC_VOICE | 2514 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |