| 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.h" | 5 #include "content/renderer/media/media_stream_audio_processor.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 | 546 |
| 547 return false; | 547 return false; |
| 548 } | 548 } |
| 549 | 549 |
| 550 void MediaStreamAudioProcessor::OnPlayoutData(media::AudioBus* audio_bus, | 550 void MediaStreamAudioProcessor::OnPlayoutData(media::AudioBus* audio_bus, |
| 551 int sample_rate, | 551 int sample_rate, |
| 552 int audio_delay_milliseconds) { | 552 int audio_delay_milliseconds) { |
| 553 DCHECK(render_thread_checker_.CalledOnValidThread()); | 553 DCHECK(render_thread_checker_.CalledOnValidThread()); |
| 554 #if defined(OS_ANDROID) | 554 #if defined(OS_ANDROID) |
| 555 DCHECK(audio_processing_->echo_control_mobile()->is_enabled()); | |
| 556 DCHECK(!audio_processing_->echo_cancellation()->is_enabled()); | 555 DCHECK(!audio_processing_->echo_cancellation()->is_enabled()); |
| 557 #else | 556 #else |
| 558 DCHECK(!audio_processing_->echo_control_mobile()->is_enabled()); | 557 DCHECK(!audio_processing_->echo_control_mobile()->is_enabled()); |
| 559 DCHECK(audio_processing_->echo_cancellation()->is_enabled()); | |
| 560 #endif | 558 #endif |
| 561 | 559 |
| 562 TRACE_EVENT0("audio", "MediaStreamAudioProcessor::OnPlayoutData"); | 560 TRACE_EVENT0("audio", "MediaStreamAudioProcessor::OnPlayoutData"); |
| 563 DCHECK_LT(audio_delay_milliseconds, | 561 DCHECK_LT(audio_delay_milliseconds, |
| 564 std::numeric_limits<base::subtle::Atomic32>::max()); | 562 std::numeric_limits<base::subtle::Atomic32>::max()); |
| 565 base::subtle::Release_Store(&render_delay_ms_, audio_delay_milliseconds); | 563 base::subtle::Release_Store(&render_delay_ms_, audio_delay_milliseconds); |
| 566 | 564 |
| 567 InitializeRenderFifoIfNeeded(sample_rate, audio_bus->channels(), | 565 InitializeRenderFifoIfNeeded(sample_rate, audio_bus->channels(), |
| 568 audio_bus->frames()); | 566 audio_bus->frames()); |
| 569 | 567 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 0 : agc->stream_analog_level(); | 889 0 : agc->stream_analog_level(); |
| 892 } | 890 } |
| 893 | 891 |
| 894 void MediaStreamAudioProcessor::UpdateAecStats() { | 892 void MediaStreamAudioProcessor::UpdateAecStats() { |
| 895 DCHECK(main_thread_runner_->BelongsToCurrentThread()); | 893 DCHECK(main_thread_runner_->BelongsToCurrentThread()); |
| 896 if (echo_information_) | 894 if (echo_information_) |
| 897 echo_information_->UpdateAecStats(audio_processing_->echo_cancellation()); | 895 echo_information_->UpdateAecStats(audio_processing_->echo_cancellation()); |
| 898 } | 896 } |
| 899 | 897 |
| 900 } // namespace content | 898 } // namespace content |
| OLD | NEW |