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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 EnableAutomaticGainControl(audio_processing_.get()); | 530 EnableAutomaticGainControl(audio_processing_.get()); |
531 | 531 |
532 RecordProcessingState(AUDIO_PROCESSING_ENABLED); | 532 RecordProcessingState(AUDIO_PROCESSING_ENABLED); |
533 } | 533 } |
534 | 534 |
535 void MediaStreamAudioProcessor::ConfigureBeamforming(webrtc::Config* config) { | 535 void MediaStreamAudioProcessor::ConfigureBeamforming(webrtc::Config* config) { |
536 bool enabled = false; | 536 bool enabled = false; |
537 std::vector<webrtc::Point> geometry(1, webrtc::Point(0.f, 0.f, 0.f)); | 537 std::vector<webrtc::Point> geometry(1, webrtc::Point(0.f, 0.f, 0.f)); |
538 #if defined(OS_CHROMEOS) | 538 #if defined(OS_CHROMEOS) |
539 const std::string board = base::SysInfo::GetLsbReleaseBoard(); | 539 const std::string board = base::SysInfo::GetLsbReleaseBoard(); |
540 if (board == "peach_pi") { | 540 if (board.find("peach_pi") != std::string::npos) { |
541 enabled = true; | 541 enabled = true; |
542 geometry.push_back(webrtc::Point(0.050f, 0.f, 0.f)); | 542 geometry.push_back(webrtc::Point(0.050f, 0.f, 0.f)); |
543 } else if (board == "swanky") { | 543 } else if (board.find("swanky") != std::string::npos) { |
544 enabled = true; | 544 enabled = true; |
545 geometry.push_back(webrtc::Point(0.052f, 0.f, 0.f)); | 545 geometry.push_back(webrtc::Point(0.052f, 0.f, 0.f)); |
546 } | 546 } |
547 #endif | 547 #endif |
548 config->Set<webrtc::Beamforming>(new webrtc::Beamforming(enabled, geometry)); | 548 config->Set<webrtc::Beamforming>(new webrtc::Beamforming(enabled, geometry)); |
549 } | 549 } |
550 | 550 |
551 void MediaStreamAudioProcessor::InitializeCaptureFifo( | 551 void MediaStreamAudioProcessor::InitializeCaptureFifo( |
552 const media::AudioParameters& input_format) { | 552 const media::AudioParameters& input_format) { |
553 DCHECK(main_thread_checker_.CalledOnValidThread()); | 553 DCHECK(main_thread_checker_.CalledOnValidThread()); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 if (echo_information_) { | 703 if (echo_information_) { |
704 echo_information_.get()->UpdateAecDelayStats(ap->echo_cancellation()); | 704 echo_information_.get()->UpdateAecDelayStats(ap->echo_cancellation()); |
705 } | 705 } |
706 | 706 |
707 // Return 0 if the volume hasn't been changed, and otherwise the new volume. | 707 // Return 0 if the volume hasn't been changed, and otherwise the new volume. |
708 return (agc->stream_analog_level() == volume) ? | 708 return (agc->stream_analog_level() == volume) ? |
709 0 : agc->stream_analog_level(); | 709 0 : agc->stream_analog_level(); |
710 } | 710 } |
711 | 711 |
712 } // namespace content | 712 } // namespace content |
OLD | NEW |