| 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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 webrtc::VoiceDetection::kVeryLowLikelihood); | 319 webrtc::VoiceDetection::kVeryLowLikelihood); |
| 320 CHECK_EQ(err, 0); | 320 CHECK_EQ(err, 0); |
| 321 | 321 |
| 322 // Configure the update period to 1s (100 * 10ms) in the typing detector. | 322 // Configure the update period to 1s (100 * 10ms) in the typing detector. |
| 323 typing_detector->SetParameters(0, 0, 0, 0, 0, 100); | 323 typing_detector->SetParameters(0, 0, 0, 0, 0, 100); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void StartEchoCancellationDump(AudioProcessing* audio_processing, | 326 void StartEchoCancellationDump(AudioProcessing* audio_processing, |
| 327 base::File aec_dump_file) { | 327 base::File aec_dump_file) { |
| 328 DCHECK(aec_dump_file.IsValid()); | 328 DCHECK(aec_dump_file.IsValid()); |
| 329 if (audio_processing->StartDebugRecordingForPlatformFile( | 329 |
| 330 aec_dump_file.TakePlatformFile())) { | 330 FILE* stream = base::FileToFILE(aec_dump_file.Pass(), "w"); |
| 331 if (!stream) { |
| 332 LOG(ERROR) << "Failed to open AEC dump file"; |
| 333 return; |
| 334 } |
| 335 |
| 336 if (audio_processing->StartDebugRecording(stream)) |
| 331 DLOG(ERROR) << "Fail to start AEC debug recording"; | 337 DLOG(ERROR) << "Fail to start AEC debug recording"; |
| 332 } | |
| 333 } | 338 } |
| 334 | 339 |
| 335 void StopEchoCancellationDump(AudioProcessing* audio_processing) { | 340 void StopEchoCancellationDump(AudioProcessing* audio_processing) { |
| 336 if (audio_processing->StopDebugRecording()) | 341 if (audio_processing->StopDebugRecording()) |
| 337 DLOG(ERROR) << "Fail to stop AEC debug recording"; | 342 DLOG(ERROR) << "Fail to stop AEC debug recording"; |
| 338 } | 343 } |
| 339 | 344 |
| 340 void EnableAutomaticGainControl(AudioProcessing* audio_processing) { | 345 void EnableAutomaticGainControl(AudioProcessing* audio_processing) { |
| 341 #if defined(OS_ANDROID) || defined(OS_IOS) | 346 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 342 const webrtc::GainControl::Mode mode = webrtc::GainControl::kFixedDigital; | 347 const webrtc::GainControl::Mode mode = webrtc::GainControl::kFixedDigital; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 } | 386 } |
| 382 | 387 |
| 383 int median = 0, std = 0; | 388 int median = 0, std = 0; |
| 384 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { | 389 if (!audio_processing->echo_cancellation()->GetDelayMetrics(&median, &std)) { |
| 385 stats->echo_delay_median_ms = median; | 390 stats->echo_delay_median_ms = median; |
| 386 stats->echo_delay_std_ms = std; | 391 stats->echo_delay_std_ms = std; |
| 387 } | 392 } |
| 388 } | 393 } |
| 389 | 394 |
| 390 } // namespace content | 395 } // namespace content |
| OLD | NEW |