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