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 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1252 adm_->Release(); | 1252 adm_->Release(); |
| 1253 adm_ = NULL; | 1253 adm_ = NULL; |
| 1254 } | 1254 } |
| 1255 if (adm) { | 1255 if (adm) { |
| 1256 adm_ = adm; | 1256 adm_ = adm; |
| 1257 adm_->AddRef(); | 1257 adm_->AddRef(); |
| 1258 } | 1258 } |
| 1259 return true; | 1259 return true; |
| 1260 } | 1260 } |
| 1261 | 1261 |
| 1262 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file) { | 1262 bool WebRtcVoiceEngine::StartAecDump(rtc::PlatformFile file, |
| 1263 int64_t max_size_bytes) { | |
|
the sun
2015/11/11 15:54:42
I don't see where max_size_bytes is used in this f
ivoc
2015/11/11 16:44:31
Wow, good find, what was I thinking? :-)
| |
| 1263 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); | 1264 FILE* aec_dump_file_stream = rtc::FdopenPlatformFileForWriting(file); |
| 1264 if (!aec_dump_file_stream) { | 1265 if (!aec_dump_file_stream) { |
| 1265 LOG(LS_ERROR) << "Could not open AEC dump file stream."; | 1266 LOG(LS_ERROR) << "Could not open AEC dump file stream."; |
| 1266 if (!rtc::ClosePlatformFile(file)) | 1267 if (!rtc::ClosePlatformFile(file)) |
| 1267 LOG(LS_WARNING) << "Could not close file."; | 1268 LOG(LS_WARNING) << "Could not close file."; |
| 1268 return false; | 1269 return false; |
| 1269 } | 1270 } |
| 1270 StopAecDump(); | 1271 StopAecDump(); |
| 1271 if (voe_wrapper_->processing()->StartDebugRecording(aec_dump_file_stream) != | 1272 if (voe_wrapper_->base()->audio_processing()->StartDebugRecording( |
| 1272 webrtc::AudioProcessing::kNoError) { | 1273 aec_dump_file_stream) != webrtc::AudioProcessing::kNoError) { |
| 1273 LOG_RTCERR0(StartDebugRecording); | 1274 LOG_RTCERR0(StartDebugRecording); |
| 1274 fclose(aec_dump_file_stream); | 1275 fclose(aec_dump_file_stream); |
| 1275 return false; | 1276 return false; |
| 1276 } | 1277 } |
| 1277 is_dumping_aec_ = true; | 1278 is_dumping_aec_ = true; |
| 1278 return true; | 1279 return true; |
| 1279 } | 1280 } |
| 1280 | 1281 |
| 1281 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { | 1282 void WebRtcVoiceEngine::StartAecDump(const std::string& filename) { |
| 1282 if (!is_dumping_aec_) { | 1283 if (!is_dumping_aec_) { |
| 1283 // Start dumping AEC when we are not dumping. | 1284 // Start dumping AEC when we are not dumping. |
| 1284 if (voe_wrapper_->processing()->StartDebugRecording( | 1285 if (voe_wrapper_->base()->audio_processing()->StartDebugRecording( |
| 1285 filename.c_str()) != webrtc::AudioProcessing::kNoError) { | 1286 filename.c_str()) != webrtc::AudioProcessing::kNoError) { |
| 1286 LOG_RTCERR1(StartDebugRecording, filename.c_str()); | 1287 LOG_RTCERR1(StartDebugRecording, filename.c_str()); |
| 1287 } else { | 1288 } else { |
| 1288 is_dumping_aec_ = true; | 1289 is_dumping_aec_ = true; |
| 1289 } | 1290 } |
| 1290 } | 1291 } |
| 1291 } | 1292 } |
| 1292 | 1293 |
| 1293 void WebRtcVoiceEngine::StopAecDump() { | 1294 void WebRtcVoiceEngine::StopAecDump() { |
| 1294 if (is_dumping_aec_) { | 1295 if (is_dumping_aec_) { |
| 1295 // Stop dumping AEC when we are dumping. | 1296 // Stop dumping AEC when we are dumping. |
| 1296 if (voe_wrapper_->processing()->StopDebugRecording() != | 1297 if (voe_wrapper_->base()->audio_processing()->StopDebugRecording() != |
| 1297 webrtc::AudioProcessing::kNoError) { | 1298 webrtc::AudioProcessing::kNoError) { |
| 1298 LOG_RTCERR0(StopDebugRecording); | 1299 LOG_RTCERR0(StopDebugRecording); |
| 1299 } | 1300 } |
| 1300 is_dumping_aec_ = false; | 1301 is_dumping_aec_ = false; |
| 1301 } | 1302 } |
| 1302 } | 1303 } |
| 1303 | 1304 |
| 1304 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { | 1305 bool WebRtcVoiceEngine::StartRtcEventLog(rtc::PlatformFile file) { |
| 1305 return voe_wrapper_->codec()->GetEventLog()->StartLogging(file); | 1306 return voe_wrapper_->codec()->GetEventLog()->StartLogging(file); |
| 1306 } | 1307 } |
| (...skipping 1688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2995 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); | 2996 LOG(LS_WARNING) << "Unknown codec " << ToString(codec); |
| 2996 return false; | 2997 return false; |
| 2997 } | 2998 } |
| 2998 } | 2999 } |
| 2999 return true; | 3000 return true; |
| 3000 } | 3001 } |
| 3001 | 3002 |
| 3002 } // namespace cricket | 3003 } // namespace cricket |
| 3003 | 3004 |
| 3004 #endif // HAVE_WEBRTC_VOICE | 3005 #endif // HAVE_WEBRTC_VOICE |
| OLD | NEW |