Chromium Code Reviews| 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..f49abe529c5cf231fec2fe4f487822af8fb6c2fe 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* handle = base::FdopenPlatformFile(aec_dump_file, "w"); |
|
Henrik Grunell
2014/03/06 10:12:20
Change "handle" -> "file_stream" or "stream".
no longer working on chromium
2014/03/06 18:57:21
Done.
|
| + if (!handle) { |
| + 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(handle)) |
| 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"; |
| } |