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

Unified Diff: content/browser/renderer_host/media/audio_input_device_manager.cc

Issue 2424163004: Factor out authorization from AudioRendererHost. (Closed)
Patch Set: Don't use separate UI thread for test. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/media/audio_input_device_manager.cc
diff --git a/content/browser/renderer_host/media/audio_input_device_manager.cc b/content/browser/renderer_host/media/audio_input_device_manager.cc
index ac6747c90ac3fe366c2597e89af016c018636afb..f0f0873aaf0289b7185f85d0abff2c62f026e25b 100644
--- a/content/browser/renderer_host/media/audio_input_device_manager.cc
+++ b/content/browser/renderer_host/media/audio_input_device_manager.cc
@@ -148,11 +148,20 @@ void AudioInputDeviceManager::OpenOnDeviceThread(
MediaStreamDevice::AudioDeviceParameters& input_params = out.device.input;
+ // Add preferred output device information if a matching output device
+ // exists.
+ out.device.matched_output_device_id =
+ audio_manager_->GetAssociatedOutputDeviceID(info.device.id);
+
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseFakeDeviceForMediaStream)) {
// Don't need to query the hardware information if using fake device.
input_params.sample_rate = 44100;
input_params.channel_layout = media::CHANNEL_LAYOUT_STEREO;
+ if (!out.device.matched_output_device_id.empty()) {
+ out.device.matched_output.sample_rate = 44100;
+ out.device.matched_output.channel_layout = media::CHANNEL_LAYOUT_STEREO;
+ }
} else {
// Get the preferred sample rate and channel configuration for the
// audio device.
@@ -163,11 +172,6 @@ void AudioInputDeviceManager::OpenOnDeviceThread(
input_params.frames_per_buffer = params.frames_per_buffer();
input_params.effects = params.effects();
input_params.mic_positions = params.mic_positions();
-
- // Add preferred output device information if a matching output device
- // exists.
- out.device.matched_output_device_id =
- audio_manager_->GetAssociatedOutputDeviceID(info.device.id);
if (!out.device.matched_output_device_id.empty()) {
params = audio_manager_->GetOutputStreamParameters(
out.device.matched_output_device_id);

Powered by Google App Engine
This is Rietveld 408576698