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/cras/audio_manager_cras.h" | 5 #include "media/audio/cras/audio_manager_cras.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/environment.h" | 8 #include "base/environment.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/nix/xdg_util.h" | 10 #include "base/nix/xdg_util.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 AudioOutputStream* AudioManagerCras::MakeOutputStream( | 131 AudioOutputStream* AudioManagerCras::MakeOutputStream( |
132 const AudioParameters& params) { | 132 const AudioParameters& params) { |
133 return new CrasUnifiedStream(params, this); | 133 return new CrasUnifiedStream(params, this); |
134 } | 134 } |
135 | 135 |
136 AudioInputStream* AudioManagerCras::MakeInputStream( | 136 AudioInputStream* AudioManagerCras::MakeInputStream( |
137 const AudioParameters& params, const std::string& device_id) { | 137 const AudioParameters& params, const std::string& device_id) { |
138 return new CrasInputStream(params, this, device_id); | 138 return new CrasInputStream(params, this, device_id); |
139 } | 139 } |
140 | 140 |
| 141 snd_pcm_format_t AudioManagerCras::BitsToFormat(int bits_per_sample) { |
| 142 switch (bits_per_sample) { |
| 143 case 8: |
| 144 return SND_PCM_FORMAT_U8; |
| 145 case 16: |
| 146 return SND_PCM_FORMAT_S16; |
| 147 case 24: |
| 148 return SND_PCM_FORMAT_S24; |
| 149 case 32: |
| 150 return SND_PCM_FORMAT_S32; |
| 151 default: |
| 152 return SND_PCM_FORMAT_UNKNOWN; |
| 153 } |
| 154 } |
| 155 |
141 } // namespace media | 156 } // namespace media |
OLD | NEW |