| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/media/audio_input_device_manager.h" | 5 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 #include "content/public/common/media_stream_request.h" | 10 #include "content/public/common/media_stream_request.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 input_params.sample_rate = 44100; | 180 input_params.sample_rate = 44100; |
| 181 input_params.channel_layout = media::CHANNEL_LAYOUT_STEREO; | 181 input_params.channel_layout = media::CHANNEL_LAYOUT_STEREO; |
| 182 } else { | 182 } else { |
| 183 // Get the preferred sample rate and channel configuration for the | 183 // Get the preferred sample rate and channel configuration for the |
| 184 // audio device. | 184 // audio device. |
| 185 media::AudioParameters params = | 185 media::AudioParameters params = |
| 186 audio_manager_->GetInputStreamParameters(info.device.id); | 186 audio_manager_->GetInputStreamParameters(info.device.id); |
| 187 input_params.sample_rate = params.sample_rate(); | 187 input_params.sample_rate = params.sample_rate(); |
| 188 input_params.channel_layout = params.channel_layout(); | 188 input_params.channel_layout = params.channel_layout(); |
| 189 input_params.frames_per_buffer = params.frames_per_buffer(); | 189 input_params.frames_per_buffer = params.frames_per_buffer(); |
| 190 input_params.effects = params.effects(); | |
| 191 | 190 |
| 192 // Add preferred output device information if a matching output device | 191 // Add preferred output device information if a matching output device |
| 193 // exists. | 192 // exists. |
| 194 out.device.matched_output_device_id = | 193 out.device.matched_output_device_id = |
| 195 audio_manager_->GetAssociatedOutputDeviceID(info.device.id); | 194 audio_manager_->GetAssociatedOutputDeviceID(info.device.id); |
| 196 if (!out.device.matched_output_device_id.empty()) { | 195 if (!out.device.matched_output_device_id.empty()) { |
| 197 params = audio_manager_->GetOutputStreamParameters( | 196 params = audio_manager_->GetOutputStreamParameters( |
| 198 out.device.matched_output_device_id); | 197 out.device.matched_output_device_id); |
| 199 MediaStreamDevice::AudioDeviceParameters& matched_output_params = | 198 MediaStreamDevice::AudioDeviceParameters& matched_output_params = |
| 200 out.device.matched_output; | 199 out.device.matched_output; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 for (StreamDeviceList::iterator i(devices_.begin()); i != devices_.end(); | 248 for (StreamDeviceList::iterator i(devices_.begin()); i != devices_.end(); |
| 250 ++i) { | 249 ++i) { |
| 251 if (i->session_id == session_id) | 250 if (i->session_id == session_id) |
| 252 return i; | 251 return i; |
| 253 } | 252 } |
| 254 | 253 |
| 255 return devices_.end(); | 254 return devices_.end(); |
| 256 } | 255 } |
| 257 | 256 |
| 258 } // namespace content | 257 } // namespace content |
| OLD | NEW |