| 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/renderer/media/audio_message_filter.h" | 5 #include "content/renderer/media/audio_message_filter.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "content/common/media/audio_messages.h" | 10 #include "content/common/media/audio_messages.h" |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // TODO(crogers): fix OnOutputDeviceChanged() to pass AudioParameters. | 227 // TODO(crogers): fix OnOutputDeviceChanged() to pass AudioParameters. |
| 228 media::ChannelLayout channel_layout = | 228 media::ChannelLayout channel_layout = |
| 229 audio_hardware_config_->GetOutputChannelLayout(); | 229 audio_hardware_config_->GetOutputChannelLayout(); |
| 230 int channels = audio_hardware_config_->GetOutputChannels(); | 230 int channels = audio_hardware_config_->GetOutputChannels(); |
| 231 | 231 |
| 232 media::AudioParameters output_params; | 232 media::AudioParameters output_params; |
| 233 output_params.Reset( | 233 output_params.Reset( |
| 234 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, | 234 media::AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 235 channel_layout, | 235 channel_layout, |
| 236 channels, | 236 channels, |
| 237 0, | |
| 238 new_sample_rate, | 237 new_sample_rate, |
| 239 16, | 238 16, |
| 240 new_buffer_size); | 239 new_buffer_size); |
| 241 | 240 |
| 242 audio_hardware_config_->UpdateOutputConfig(output_params); | 241 audio_hardware_config_->UpdateOutputConfig(output_params); |
| 243 } | 242 } |
| 244 | 243 |
| 245 void AudioMessageFilter::SetAudioHardwareConfig( | 244 void AudioMessageFilter::SetAudioHardwareConfig( |
| 246 media::AudioHardwareConfig* config) { | 245 media::AudioHardwareConfig* config) { |
| 247 base::AutoLock auto_lock(lock_); | 246 base::AutoLock auto_lock(lock_); |
| 248 audio_hardware_config_ = config; | 247 audio_hardware_config_ = config; |
| 249 } | 248 } |
| 250 | 249 |
| 251 } // namespace content | 250 } // namespace content |
| OLD | NEW |