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

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

Issue 2424163004: Factor out authorization from AudioRendererHost. (Closed)
Patch Set: const& 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 30260b10e6a325c1a630dae61371c52f91955a06..5169b30f463485f69c58794194ae292adfd84bae 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);
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/renderer_host/media/audio_output_authorization_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698