| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/media_stream_audio_processor_options.h" | 5 #include "content/renderer/media/media_stream_audio_processor_options.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 webrtc::VoiceDetection::kVeryLowLikelihood); | 244 webrtc::VoiceDetection::kVeryLowLikelihood); |
| 245 CHECK_EQ(err, 0); | 245 CHECK_EQ(err, 0); |
| 246 | 246 |
| 247 // Configure the update period to 1s (100 * 10ms) in the typing detector. | 247 // Configure the update period to 1s (100 * 10ms) in the typing detector. |
| 248 typing_detector->SetParameters(0, 0, 0, 0, 0, 100); | 248 typing_detector->SetParameters(0, 0, 0, 0, 0, 100); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void StartEchoCancellationDump(AudioProcessing* audio_processing, | 251 void StartEchoCancellationDump(AudioProcessing* audio_processing, |
| 252 base::File aec_dump_file) { | 252 base::File aec_dump_file) { |
| 253 DCHECK(aec_dump_file.IsValid()); | 253 DCHECK(aec_dump_file.IsValid()); |
| 254 | 254 if (audio_processing->StartDebugRecordingForPlatformFile( |
| 255 FILE* stream = base::FileToFILE(aec_dump_file.Pass(), "w"); | 255 aec_dump_file.TakePlatformFile())) { |
| 256 if (!stream) { | 256 DLOG(ERROR) << "Fail to start AEC debug recording"; |
| 257 LOG(ERROR) << "Failed to open AEC dump file"; | |
| 258 return; | |
| 259 } | 257 } |
| 260 | |
| 261 if (audio_processing->StartDebugRecording(stream)) | |
| 262 DLOG(ERROR) << "Fail to start AEC debug recording"; | |
| 263 } | 258 } |
| 264 | 259 |
| 265 void StopEchoCancellationDump(AudioProcessing* audio_processing) { | 260 void StopEchoCancellationDump(AudioProcessing* audio_processing) { |
| 266 if (audio_processing->StopDebugRecording()) | 261 if (audio_processing->StopDebugRecording()) |
| 267 DLOG(ERROR) << "Fail to stop AEC debug recording"; | 262 DLOG(ERROR) << "Fail to stop AEC debug recording"; |
| 268 } | 263 } |
| 269 | 264 |
| 270 void EnableAutomaticGainControl(AudioProcessing* audio_processing) { | 265 void EnableAutomaticGainControl(AudioProcessing* audio_processing) { |
| 271 #if defined(OS_ANDROID) || defined(OS_IOS) | 266 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 272 const webrtc::GainControl::Mode mode = webrtc::GainControl::kFixedDigital; | 267 const webrtc::GainControl::Mode mode = webrtc::GainControl::kFixedDigital; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 } | 306 } |
| 312 | 307 |
| 313 int median = 0, std = 0; | 308 int median = 0, std = 0; |
| 314 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { | 309 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { |
| 315 stats->echo_delay_median_ms = median; | 310 stats->echo_delay_median_ms = median; |
| 316 stats->echo_delay_std_ms = std; | 311 stats->echo_delay_std_ms = std; |
| 317 } | 312 } |
| 318 } | 313 } |
| 319 | 314 |
| 320 } // namespace content | 315 } // namespace content |
| OLD | NEW |