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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 adm_->Release(); | 1004 adm_->Release(); |
1005 adm_ = NULL; | 1005 adm_ = NULL; |
1006 } | 1006 } |
1007 if (adm) { | 1007 if (adm) { |
1008 adm_ = adm; | 1008 adm_ = adm; |
1009 adm_->AddRef(); | 1009 adm_->AddRef(); |
1010 } | 1010 } |
1011 return true; | 1011 return true; |
1012 } | 1012 } |
1013 | 1013 |
1014 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file) { | 1014 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file, |
| 1015 int64_t max_size_bytes) { |
1015 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1016 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1016 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); | 1017 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); |
1017 if (!aec_dump_file_stream) { | 1018 if (!aec_dump_file_stream) { |
1018 LOG(LS_ERROR) << "Could not open AEC dump file stream."; | 1019 LOG(LS_ERROR) << "Could not open AEC dump file stream."; |
1019 if (!rtc::ClosePlatformFile(file)) | 1020 if (!rtc::ClosePlatformFile(file)) |
1020 LOG(LS_WARNING) << "Could not close file."; | 1021 LOG(LS_WARNING) << "Could not close file."; |
1021 return false; | 1022 return false; |
1022 } | 1023 } |
1023 StopAecDump(); | 1024 StopAecDump(); |
1024 if (voe_wrapper_->processing()->StartDebugRecording(aec_dump_file_stream) != | 1025 if (voe_wrapper_->base()->audio_processing()->StartDebugRecording( |
| 1026 aec_dump_file_stream, max_size_bytes) != |
1025 webrtc::AudioProcessing::kNoError) { | 1027 webrtc::AudioProcessing::kNoError) { |
1026 LOG_RTCERR0(StartDebugRecording); | 1028 LOG_RTCERR0(StartDebugRecording); |
1027 fclose(aec_dump_file_stream); | 1029 fclose(aec_dump_file_stream); |
1028 return false; | 1030 return false; |
1029 } | 1031 } |
1030 is_dumping_aec_ = true; | 1032 is_dumping_aec_ = true; |
1031 return true; | 1033 return true; |
1032 } | 1034 } |
1033 | 1035 |
1034 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { | 1036 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { |
1035 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1037 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1036 if (!is_dumping_aec_) { | 1038 if (!is_dumping_aec_) { |
1037 // Start dumping AEC when we are not dumping. | 1039 // Start dumping AEC when we are not dumping. |
1038 if (voe_wrapper_->processing()->StartDebugRecording( | 1040 if (voe_wrapper_->base()->audio_processing()->StartDebugRecording( |
1039 filename.c_str()) != webrtc::AudioProcessing::kNoError) { | 1041 filename.c_str(), -1) != webrtc::AudioProcessing::kNoError) { |
1040 LOG_RTCERR1(StartDebugRecording, filename.c_str()); | 1042 LOG_RTCERR1(StartDebugRecording, filename.c_str()); |
1041 } else { | 1043 } else { |
1042 is_dumping_aec_ = true; | 1044 is_dumping_aec_ = true; |
1043 } | 1045 } |
1044 } | 1046 } |
1045 } | 1047 } |
1046 | 1048 |
1047 void WebRtcVoiceEngine::StopAecDump() { | 1049 void WebRtcVoiceEngine::StopAecDump() { |
1048 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1050 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1049 if (is_dumping_aec_) { | 1051 if (is_dumping_aec_) { |
1050 // Stop dumping AEC when we are dumping. | 1052 // Stop dumping AEC when we are dumping. |
1051 if (voe_wrapper_->processing()->StopDebugRecording() != | 1053 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != |
1052 webrtc::AudioProcessing::kNoError) { | 1054 webrtc::AudioProcessing::kNoError) { |
1053 LOG_RTCERR0(StopDebugRecording); | 1055 LOG_RTCERR0(StopDebugRecording); |
1054 } | 1056 } |
1055 is_dumping_aec_ = false; | 1057 is_dumping_aec_ = false; |
1056 } | 1058 } |
1057 } | 1059 } |
1058 | 1060 |
1059 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { | 1061 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { |
1060 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1062 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1061 return voe_wrapper_->codec()->GetEventLog()->StartLogging(file); | 1063 return voe_wrapper_->codec()->GetEventLog()->StartLogging(file); |
(...skipping 1438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2500 } | 2502 } |
2501 } else { | 2503 } else { |
2502 LOG(LS_INFO) << "Stopping playout for channel #" << channel; | 2504 LOG(LS_INFO) << "Stopping playout for channel #" << channel; |
2503 engine()->voe()->base()->StopPlayout(channel); | 2505 engine()->voe()->base()->StopPlayout(channel); |
2504 } | 2506 } |
2505 return true; | 2507 return true; |
2506 } | 2508 } |
2507 } // namespace cricket | 2509 } // namespace cricket |
2508 | 2510 |
2509 #endif // HAVE_WEBRTC_VOICE | 2511 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |