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

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: minor fix to one comment. 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 0fcf8f7247cf57376d16bfd4ae1834668cab97b0..12338e227e77a17bb5798fb7300ea47705823580 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);
-#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()))
+ FILE* stream = base::FdopenPlatformFile(aec_dump_file, "w");
+ if (!stream) {
+ LOG(ERROR) << "Failed to open AEC dump file";
+ return;
+ }
+
+ 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