OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "media/base/audio_hardware_config.h" |
| 6 |
| 7 namespace media { |
| 8 |
| 9 AudioHardwareConfig::AudioHardwareConfig( |
| 10 int output_buffer_size, int output_sample_rate, |
| 11 int input_sample_rate, ChannelLayout input_channel_layout) |
| 12 : output_buffer_size_(output_buffer_size), |
| 13 output_sample_rate_(output_sample_rate), |
| 14 input_sample_rate_(input_sample_rate), |
| 15 input_channel_layout_(input_channel_layout) { |
| 16 } |
| 17 |
| 18 AudioHardwareConfig::~AudioHardwareConfig() {} |
| 19 |
| 20 int AudioHardwareConfig::GetOutputBufferSize() { |
| 21 base::AutoLock auto_lock(config_lock_); |
| 22 return output_buffer_size_; |
| 23 } |
| 24 |
| 25 int AudioHardwareConfig::GetOutputSampleRate() { |
| 26 base::AutoLock auto_lock(config_lock_); |
| 27 return output_sample_rate_; |
| 28 } |
| 29 |
| 30 int AudioHardwareConfig::GetInputSampleRate() { |
| 31 base::AutoLock auto_lock(config_lock_); |
| 32 return input_sample_rate_; |
| 33 } |
| 34 |
| 35 ChannelLayout AudioHardwareConfig::GetInputChannelLayout() { |
| 36 base::AutoLock auto_lock(config_lock_); |
| 37 return input_channel_layout_; |
| 38 } |
| 39 |
| 40 void AudioHardwareConfig::UpdateInputConfig( |
| 41 int sample_rate, media::ChannelLayout channel_layout) { |
| 42 base::AutoLock auto_lock(config_lock_); |
| 43 input_sample_rate_ = sample_rate; |
| 44 input_channel_layout_ = channel_layout; |
| 45 } |
| 46 |
| 47 void AudioHardwareConfig::UpdateOutputConfig(int buffer_size, int sample_rate) { |
| 48 base::AutoLock auto_lock(config_lock_); |
| 49 output_buffer_size_ = buffer_size; |
| 50 output_sample_rate_ = sample_rate; |
| 51 } |
| 52 |
| 53 } // namespace media |
OLD | NEW |