OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/audio/fake_audio_manager.h" | 5 #include "media/audio/fake_audio_manager.h" |
6 | 6 |
7 namespace media { | 7 namespace media { |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 int sample_rate = kDefaultSampleRate; | 58 int sample_rate = kDefaultSampleRate; |
59 int buffer_size = kDefaultOutputBufferSize; | 59 int buffer_size = kDefaultOutputBufferSize; |
60 int bits_per_sample = 16; | 60 int bits_per_sample = 16; |
61 if (input_params.IsValid()) { | 61 if (input_params.IsValid()) { |
62 sample_rate = input_params.sample_rate(); | 62 sample_rate = input_params.sample_rate(); |
63 bits_per_sample = input_params.bits_per_sample(); | 63 bits_per_sample = input_params.bits_per_sample(); |
64 channel_layout = input_params.channel_layout(); | 64 channel_layout = input_params.channel_layout(); |
65 buffer_size = std::min(input_params.frames_per_buffer(), buffer_size); | 65 buffer_size = std::min(input_params.frames_per_buffer(), buffer_size); |
66 } | 66 } |
67 | 67 |
68 return AudioParameters( | 68 return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, |
69 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, | 69 sample_rate, bits_per_sample, buffer_size); |
70 sample_rate, bits_per_sample, buffer_size, AudioParameters::NO_EFFECTS); | |
71 } | 70 } |
72 | 71 |
73 AudioParameters FakeAudioManager::GetInputStreamParameters( | 72 AudioParameters FakeAudioManager::GetInputStreamParameters( |
74 const std::string& device_id) { | 73 const std::string& device_id) { |
75 return AudioParameters( | 74 return AudioParameters( |
76 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, | 75 AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, |
77 kDefaultSampleRate, 16, kDefaultInputBufferSize); | 76 kDefaultSampleRate, 16, kDefaultInputBufferSize); |
78 } | 77 } |
79 | 78 |
80 } // namespace media | 79 } // namespace media |
OLD | NEW |