diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 23:37:39 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-08 23:37:39 +0000 |
commit | 45d1f5634d022ef57001186125eb098c555c35a1 (patch) | |
tree | 0415bdb1beba2497a9bb58190d233075b0e1def9 /media | |
parent | 834acbd835f74643062c170feafc26475a897247 (diff) | |
download | chromium_src-45d1f5634d022ef57001186125eb098c555c35a1.zip chromium_src-45d1f5634d022ef57001186125eb098c555c35a1.tar.gz chromium_src-45d1f5634d022ef57001186125eb098c555c35a1.tar.bz2 |
Revert 187048
based on
http://build.chromium.org/p/chromium.win/builders/Win%20Aura%20Tests%20%282%29/builds/1968
> Enable the "Web Audio Input" feature by default.
>
> We now get the proper audio input device identifier passed into WebKit and back into chromium
> to be able to determine if the correct device will be used that the user gave permission to
> access in getUserMedia().
>
> See related WebKit work:
> https://bugs.webkit.org/show_bug.cgi?id=90110
> https://bugs.webkit.org/show_bug.cgi?id=93756
> https://bugs.webkit.org/show_bug.cgi?id=101815
> https://bugs.webkit.org/show_bug.cgi?id=106490
> https://bugs.webkit.org/show_bug.cgi?id=106816
> https://bugs.webkit.org/show_bug.cgi?id=109494
> https://bugs.webkit.org/show_bug.cgi?id=110796
>
> and chromium work:
> https://codereview.chromium.org/10830268/
> https://codereview.chromium.org/10916105/
> https://codereview.chromium.org/10909185/
> https://codereview.chromium.org/10959068
> https://codereview.chromium.org/11418125/
> https://codereview.chromium.org/11827040/
> https://codereview.chromium.org/11878032/
> https://codereview.chromium.org/12218106/
> https://codereview.chromium.org/12335072/
>
> BUG=145092
> TEST=none
> manual tests:
> http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html
> http://dashersw.github.com/pedalboard.js/demo/
> Review URL: https://codereview.chromium.org/12383064
TBR=crogers@google.com
Review URL: https://codereview.chromium.org/12649007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/mac/audio_manager_mac.cc | 11 | ||||
-rw-r--r-- | media/audio/win/audio_manager_win.cc | 6 | ||||
-rw-r--r-- | media/audio/win/audio_unified_win_unittest.cc | 6 | ||||
-rw-r--r-- | media/base/media_switches.cc | 3 | ||||
-rw-r--r-- | media/base/media_switches.h | 2 |
5 files changed, 24 insertions, 4 deletions
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc index 2184e12..15f570d 100644 --- a/media/audio/mac/audio_manager_mac.cc +++ b/media/audio/mac/audio_manager_mac.cc @@ -298,7 +298,11 @@ AudioOutputStream* AudioManagerMac::MakeLowLatencyOutputStream( DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); // TODO(crogers): support more than stereo input. - if (params.input_channels() == 2) { + // TODO(crogers): remove flag once we handle input device selection. + // https://code.google.com/p/chromium/issues/detail?id=147327 + if (params.input_channels() == 2 && + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebAudioInput)) { if (HasUnifiedDefaultIO()) return new AudioHardwareUnifiedStream(this, params); @@ -340,9 +344,10 @@ AudioParameters AudioManagerMac::GetPreferredOutputStreamParameters( channel_layout = input_params.channel_layout(); input_channels = input_params.input_channels(); - if (input_channels > 0) { + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebAudioInput)) { // TODO(crogers): given the limitations of the AudioOutputStream - // back-ends used with synchronized I/O, we hard-code to stereo. + // back-ends used with kEnableWebAudioInput, we hard-code to stereo. // Specifically, this is a limitation of AudioSynchronizedStream which // can be removed as part of the work to consolidate these back-ends. channel_layout = CHANNEL_LAYOUT_STEREO; diff --git a/media/audio/win/audio_manager_win.cc b/media/audio/win/audio_manager_win.cc index fff5be5..fe129ad 100644 --- a/media/audio/win/audio_manager_win.cc +++ b/media/audio/win/audio_manager_win.cc @@ -315,7 +315,11 @@ AudioOutputStream* AudioManagerWin::MakeLowLatencyOutputStream( } // TODO(crogers): support more than stereo input. - if (params.input_channels() == 2) { + // TODO(henrika): remove flag once we properly handle input device selection. + // https://code.google.com/p/chromium/issues/detail?id=147327 + if (params.input_channels() == 2 && + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebAudioInput)) { if (WASAPIUnifiedStream::HasUnifiedDefaultIO()) { DVLOG(1) << "WASAPIUnifiedStream is created."; return new WASAPIUnifiedStream(this, params); diff --git a/media/audio/win/audio_unified_win_unittest.cc b/media/audio/win/audio_unified_win_unittest.cc index 26304f1..89c67bd 100644 --- a/media/audio/win/audio_unified_win_unittest.cc +++ b/media/audio/win/audio_unified_win_unittest.cc @@ -123,6 +123,12 @@ class UnifiedSourceCallback : public AudioOutputStream::AudioSourceCallback { // Convenience method which ensures that we fulfill all required conditions // to run unified audio tests on Windows. static bool CanRunUnifiedAudioTests(AudioManager* audio_man) { + const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + if (!cmd_line->HasSwitch(switches::kEnableWebAudioInput)) { + DVLOG(1) << "--enable-webaudio-input must be defined to run this test."; + return false; + } + if (!CoreAudioUtil::IsSupported()) { LOG(WARNING) << "This tests requires Windows Vista or higher."; return false; diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index e9c00f6..266a9d2 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc @@ -47,6 +47,9 @@ const char kDisableRendererSideMixing[] = "disable-renderer-side-mixing"; // Enable browser-side audio mixer. const char kEnableAudioMixer[] = "enable-audio-mixer"; +// Enable live audio input with getUserMedia() and the Web Audio API. +const char kEnableWebAudioInput[] = "enable-webaudio-input"; + // Set number of threads to use for video decoding. const char kVideoThreads[] = "video-threads"; diff --git a/media/base/media_switches.h b/media/base/media_switches.h index a2aa987..cd092e9 100644 --- a/media/base/media_switches.h +++ b/media/base/media_switches.h @@ -39,6 +39,8 @@ MEDIA_EXPORT extern const char kDisableRendererSideMixing[]; MEDIA_EXPORT extern const char kEnableAudioMixer[]; +MEDIA_EXPORT extern const char kEnableWebAudioInput[]; + MEDIA_EXPORT extern const char kVideoThreads[]; MEDIA_EXPORT extern const char kDisableEncryptedMedia[]; |