diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 7 | ||||
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 1 | ||||
-rw-r--r-- | content/renderer/media/webrtc_local_audio_renderer.cc | 13 | ||||
-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 |
9 files changed, 45 insertions, 10 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 64b381d..9758e4d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6625,6 +6625,12 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ASH_ENABLE_FULL_BROWSER_LIST_IN_LAUNCHER_DESCRIPTION" desc="Description for the option to enable/disable the full browser list experiment in the launcher."> Enable full browser / tab list for the browser item in the launcher. </message> + <message name="IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME" desc="Title for the flag to enable the webaudio input feature."> + Web Audio Input + </message> + <message name="IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION" desc="Title for the flag to enable the webaudio input feature."> + Enables live audio input using getUserMedia() and the Web Audio API. + </message> <message name="IDS_FLAGS_DISABLE_GESTURE_REQUIREMENT_FOR_MEDIA_PLAYBACK_NAME" desc="Title for the flag to disable gesture requiment for media playback"> Disable gesture requirement for media playback. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index e54e85a..572e592 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1052,6 +1052,13 @@ const Experiment kExperiments[] = { }, #endif { + "enable-webaudio-input", + IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_NAME, + IDS_FLAGS_ENABLE_WEBAUDIO_INPUT_DESCRIPTION, + kOsDesktop, + SINGLE_VALUE_TYPE(switches::kEnableWebAudioInput), + }, + { "enable-contacts", IDS_FLAGS_ENABLE_CONTACTS_NAME, IDS_FLAGS_ENABLE_CONTACTS_DESCRIPTION, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index b598f4e..b7c5ffc 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -760,6 +760,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( #else switches::kDisableWebAudio, #endif + switches::kEnableWebAudioInput, switches::kDisableWebSockets, switches::kDomAutomationController, switches::kEnableAccessibilityLogging, diff --git a/content/renderer/media/webrtc_local_audio_renderer.cc b/content/renderer/media/webrtc_local_audio_renderer.cc index ce30579..f24045a 100644 --- a/content/renderer/media/webrtc_local_audio_renderer.cc +++ b/content/renderer/media/webrtc_local_audio_renderer.cc @@ -170,12 +170,13 @@ void WebRtcLocalAudioRenderer::Start() { source_params.bits_per_sample(), 2 * source_params.frames_per_buffer()); sink_ = AudioDeviceFactory::NewOutputDevice(); - - // TODO(henrika): we could utilize the unified audio here instead and do - // sink_->InitializeIO(sink_params, 2, callback_.get()); - // It would then be possible to avoid using the WebRtcAudioCapturer. - DVLOG(1) << "The live audio input feature is enabled"; - + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebAudioInput)) { + // TODO(henrika): we could utilize the unified audio here instead and do + // sink_->InitializeIO(sink_params, 2, callback_.get()); + // It would then be possible to avoid using the WebRtcAudioCapturer. + DVLOG(1) << "enable-webaudio-input command-line flag is enabled"; + } sink_->Initialize(sink_params, callback_.get()); sink_->SetSourceRenderView(source_render_view_id_); 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[]; |