Chromium Code Reviews| 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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 992 int64_t max_size_bytes) { | 992 int64_t max_size_bytes) { |
| 993 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 993 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 994 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); | 994 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); |
| 995 if (!aec_dump_file_stream) { | 995 if (!aec_dump_file_stream) { |
| 996 LOG(LS_ERROR) << "Could not open AEC dump file stream."; | 996 LOG(LS_ERROR) << "Could not open AEC dump file stream."; |
| 997 if (!rtc::ClosePlatformFile(file)) | 997 if (!rtc::ClosePlatformFile(file)) |
| 998 LOG(LS_WARNING) << "Could not close file."; | 998 LOG(LS_WARNING) << "Could not close file."; |
| 999 return false; | 999 return false; |
| 1000 } | 1000 } |
| 1001 StopAecDump(); | 1001 StopAecDump(); |
| 1002 if (apm()->StartDebugRecording(aec_dump_file_stream, max_size_bytes) != | 1002 if (apm()->StartDebugRecording(aec_dump_file_stream, max_size_bytes, |
|
the sun
2017/03/28 22:35:29
Could we get rid of these calls on the APM and jus
aleloi
2017/04/06 15:46:10
Sure! I've added a new APM::StartDebugRecording me
| |
| 1003 nullptr) != | |
| 1003 webrtc::AudioProcessing::kNoError) { | 1004 webrtc::AudioProcessing::kNoError) { |
| 1004 LOG_RTCERR0(StartDebugRecording); | 1005 LOG_RTCERR0(StartDebugRecording); |
| 1005 fclose(aec_dump_file_stream); | 1006 fclose(aec_dump_file_stream); |
| 1006 return false; | 1007 return false; |
| 1007 } | 1008 } |
| 1008 is_dumping_aec_ = true; | 1009 is_dumping_aec_ = true; |
| 1009 return true; | 1010 return true; |
| 1010 } | 1011 } |
| 1011 | 1012 |
| 1012 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { | 1013 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { |
| 1013 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1014 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| 1014 if (!is_dumping_aec_) { | 1015 if (!is_dumping_aec_) { |
| 1015 // Start dumping AEC when we are not dumping. | 1016 // Start dumping AEC when we are not dumping. |
| 1016 if (apm()->StartDebugRecording(filename.c_str(), -1) != | 1017 if (apm()->StartDebugRecording(filename.c_str(), -1, nullptr) != |
| 1017 webrtc::AudioProcessing::kNoError) { | 1018 webrtc::AudioProcessing::kNoError) { |
| 1018 LOG_RTCERR1(StartDebugRecording, filename.c_str()); | 1019 LOG_RTCERR1(StartDebugRecording, filename.c_str()); |
| 1019 } else { | 1020 } else { |
| 1020 is_dumping_aec_ = true; | 1021 is_dumping_aec_ = true; |
| 1021 } | 1022 } |
| 1022 } | 1023 } |
| 1023 } | 1024 } |
| 1024 | 1025 |
| 1025 void WebRtcVoiceEngine::StopAecDump() { | 1026 void WebRtcVoiceEngine::StopAecDump() { |
| 1026 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1027 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
| (...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2626 ssrc); | 2627 ssrc); |
| 2627 if (it != unsignaled_recv_ssrcs_.end()) { | 2628 if (it != unsignaled_recv_ssrcs_.end()) { |
| 2628 unsignaled_recv_ssrcs_.erase(it); | 2629 unsignaled_recv_ssrcs_.erase(it); |
| 2629 return true; | 2630 return true; |
| 2630 } | 2631 } |
| 2631 return false; | 2632 return false; |
| 2632 } | 2633 } |
| 2633 } // namespace cricket | 2634 } // namespace cricket |
| 2634 | 2635 |
| 2635 #endif // HAVE_WEBRTC_VOICE | 2636 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |