Chromium Code Reviews| 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 1260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1271 if (voe_wrapper_->processing()->StartDebugRecording(aec_dump_file_stream) != | 1271 if (voe_wrapper_->processing()->StartDebugRecording(aec_dump_file_stream) != |
| 1272 webrtc::AudioProcessing::kNoError) { | 1272 webrtc::AudioProcessing::kNoError) { |
| 1273 LOG_RTCERR0(StartDebugRecording); | 1273 LOG_RTCERR0(StartDebugRecording); |
| 1274 fclose(aec_dump_file_stream); | 1274 fclose(aec_dump_file_stream); |
| 1275 return false; | 1275 return false; |
| 1276 } | 1276 } |
| 1277 is_dumping_aec_ = true; | 1277 is_dumping_aec_ = true; |
| 1278 return true; | 1278 return true; |
| 1279 } | 1279 } |
| 1280 | 1280 |
| 1281 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file, | |
| 1282 int max_size_bytes) { | |
| 1283 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); | |
| 1284 if (!aec_dump_file_stream) { | |
| 1285 LOG(LS_ERROR) << "Could not open AEC dump file stream."; | |
| 1286 if (!rtc::ClosePlatformFile(file)) | |
| 1287 LOG(LS_WARNING) << "Could not close file."; | |
| 1288 return false; | |
| 1289 } | |
| 1290 StopAecDump(); | |
| 1291 if (voe_wrapper_->processing()->StartDebugRecording(aec_dump_file_stream, | |
| 1292 max_size_bytes) != | |
| 1293 webrtc::AudioProcessing::kNoError) { | |
| 1294 LOG_RTCERR0(StartDebugRecording); | |
| 1295 fclose(aec_dump_file_stream); | |
| 1296 return false; | |
| 1297 } | |
| 1298 is_dumping_aec_ = true; | |
| 1299 return true; | |
| 1300 } | |
|
kwiberg-webrtc
2015/10/25 02:29:12
This duplicates a lot of the preceding function. C
the sun
2015/10/26 10:37:20
See previous comment in PeerConnectionFactory: we
ivoc
2015/11/05 13:14:45
Done.
| |
| 1301 | |
| 1281 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { | 1302 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { |
| 1282 if (!is_dumping_aec_) { | 1303 if (!is_dumping_aec_) { |
| 1283 // Start dumping AEC when we are not dumping. | 1304 // Start dumping AEC when we are not dumping. |
| 1284 if (voe_wrapper_->processing()->StartDebugRecording( | 1305 if (voe_wrapper_->processing()->StartDebugRecording( |
| 1285 filename.c_str()) != webrtc::AudioProcessing::kNoError) { | 1306 filename.c_str()) != webrtc::AudioProcessing::kNoError) { |
| 1286 LOG_RTCERR1(StartDebugRecording, filename.c_str()); | 1307 LOG_RTCERR1(StartDebugRecording, filename.c_str()); |
| 1287 } else { | 1308 } else { |
| 1288 is_dumping_aec_ = true; | 1309 is_dumping_aec_ = true; |
| 1289 } | 1310 } |
| 1290 } | 1311 } |
| (...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2995 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); | 3016 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); |
| 2996 return false; | 3017 return false; |
| 2997 } | 3018 } |
| 2998 } | 3019 } |
| 2999 return true; | 3020 return true; |
| 3000 } | 3021 } |
| 3001 | 3022 |
| 3002 } // namespace cricket | 3023 } // namespace cricket |
| 3003 | 3024 |
| 3004 #endif // HAVE_WEBRTC_VOICE | 3025 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |