Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: content/renderer/media/media_stream_audio_processor.cc

Issue 816353011: Enable beamforming in Swanky (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 EnableAutomaticGainControl(audio_processing_.get()); 517 EnableAutomaticGainControl(audio_processing_.get());
518 518
519 RecordProcessingState(AUDIO_PROCESSING_ENABLED); 519 RecordProcessingState(AUDIO_PROCESSING_ENABLED);
520 } 520 }
521 521
522 void MediaStreamAudioProcessor::ConfigureBeamforming(webrtc::Config* config) { 522 void MediaStreamAudioProcessor::ConfigureBeamforming(webrtc::Config* config) {
523 bool enabled = false; 523 bool enabled = false;
524 std::vector<webrtc::Point> geometry(1, webrtc::Point(0.f, 0.f, 0.f)); 524 std::vector<webrtc::Point> geometry(1, webrtc::Point(0.f, 0.f, 0.f));
525 #if defined(OS_CHROMEOS) 525 #if defined(OS_CHROMEOS)
526 const std::string board = base::SysInfo::GetLsbReleaseBoard(); 526 const std::string board = base::SysInfo::GetLsbReleaseBoard();
527 if (board == "peach_pi") { 527 if (board == "peach_pi") {
Pawel Osciak 2015/01/16 02:26:21 Could we have a generic commandline flag for beam
aluebs-chromium 2015/01/21 19:18:21 I would be happy to do it that way. My only concer
Pawel Osciak 2015/01/22 01:56:52 Is there an API you can query to get it?
aluebs-chromium 2015/01/22 01:59:08 No, they depend on the device and they are hard-co
528 enabled = true; 528 enabled = true;
529 geometry.push_back(webrtc::Point(0.050f, 0.f, 0.f)); 529 geometry.push_back(webrtc::Point(0.050f, 0.f, 0.f));
530 } else if (board == "swanky") { 530 } else if (board == "swanky") {
531 // TODO(aluebs): Verify beamforming works on Swanky and enable. 531 enabled = true;
532 enabled = false;
533 geometry.push_back(webrtc::Point(0.052f, 0.f, 0.f)); 532 geometry.push_back(webrtc::Point(0.052f, 0.f, 0.f));
534 } 533 }
535 #endif 534 #endif
536 config->Set<webrtc::Beamforming>(new webrtc::Beamforming(enabled, geometry)); 535 config->Set<webrtc::Beamforming>(new webrtc::Beamforming(enabled, geometry));
537 } 536 }
538 537
539 void MediaStreamAudioProcessor::InitializeCaptureFifo( 538 void MediaStreamAudioProcessor::InitializeCaptureFifo(
540 const media::AudioParameters& input_format) { 539 const media::AudioParameters& input_format) {
541 DCHECK(main_thread_checker_.CalledOnValidThread()); 540 DCHECK(main_thread_checker_.CalledOnValidThread());
542 DCHECK(input_format.IsValid()); 541 DCHECK(input_format.IsValid());
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 vad->stream_has_voice()); 678 vad->stream_has_voice());
680 base::subtle::Release_Store(&typing_detected_, detected); 679 base::subtle::Release_Store(&typing_detected_, detected);
681 } 680 }
682 681
683 // Return 0 if the volume hasn't been changed, and otherwise the new volume. 682 // Return 0 if the volume hasn't been changed, and otherwise the new volume.
684 return (agc->stream_analog_level() == volume) ? 683 return (agc->stream_analog_level() == volume) ?
685 0 : agc->stream_analog_level(); 684 0 : agc->stream_analog_level();
686 } 685 }
687 686
688 } // namespace content 687 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698