Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: content/renderer/media/media_stream_audio_processor_options.cc

Issue 187913002: Support the Aec dump for the APM in chrome (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: only allow calling StartAecDump() on one APM. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_processor_options.cc
diff --git a/content/renderer/media/media_stream_audio_processor_options.cc b/content/renderer/media/media_stream_audio_processor_options.cc
index 0a3eeca2d0e13251a8cab5c1452cdbcde2a78795..2155c8d03184a745d78155a4e6ce131a25323718 100644
--- a/content/renderer/media/media_stream_audio_processor_options.cc
+++ b/content/renderer/media/media_stream_audio_processor_options.cc
@@ -144,29 +144,21 @@ void EnableExperimentalEchoCancellation(AudioProcessing* audio_processing) {
audio_processing->SetExtraOptions(config);
}
-void StartAecDump(AudioProcessing* audio_processing) {
- // TODO(grunell): Figure out a more suitable directory for the audio dump
- // data.
- base::FilePath path;
-#if defined(CHROMEOS)
- PathService::Get(base::DIR_TEMP, &path);
-#elif defined(ANDROID)
- path = base::FilePath(FILE_PATH_LITERAL("sdcard"));
-#else
- PathService::Get(base::DIR_EXE, &path);
-#endif
- base::FilePath file = path.Append(FILE_PATH_LITERAL("audio.aecdump"));
+void StartEchoCancellationDump(AudioProcessing* audio_processing,
+ const base::PlatformFile& aec_dump_file) {
+ DCHECK_NE(aec_dump_file, base::kInvalidPlatformFileValue);
+
+ FILE* stream = base::FdopenPlatformFile(aec_dump_file, "w");
+ if (!stream) {
+ LOG(ERROR) << "Failed to open AEC dump file";
+ return;
+ }
-#if defined(OS_WIN)
- const std::string file_name = base::WideToUTF8(file.value());
-#else
- const std::string file_name = file.value();
-#endif
- if (audio_processing->StartDebugRecording(file_name.c_str()))
+ if (audio_processing->StartDebugRecording(stream))
DLOG(ERROR) << "Fail to start AEC debug recording";
}
-void StopAecDump(AudioProcessing* audio_processing) {
+void StopEchoCancellationDump(AudioProcessing* audio_processing) {
if (audio_processing->StopDebugRecording())
DLOG(ERROR) << "Fail to stop AEC debug recording";
}

Powered by Google App Engine
This is Rietveld 408576698