Chromium Code Reviews| 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" |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "media/audio/audio_util.h" | 13 #include "media/audio/audio_util.h" |
| 14 #include "media/audio/cras/cras_input.h" | 14 #include "media/audio/cras/cras_input.h" |
| 15 #include "media/audio/cras/cras_output.h" | 15 #include "media/audio/cras/cras_unified.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 // Maximum number of output streams that can be open simultaneously. | 19 // Maximum number of output streams that can be open simultaneously. |
| 20 static const int kMaxOutputStreams = 50; | 20 static const int kMaxOutputStreams = 50; |
| 21 | 21 |
| 22 static const char kCrasAutomaticDeviceName[] = "Automatic"; | 22 static const char kCrasAutomaticDeviceName[] = "Automatic"; |
| 23 static const char kCrasAutomaticDeviceId[] = "automatic"; | 23 static const char kCrasAutomaticDeviceId[] = "automatic"; |
| 24 | 24 |
| 25 bool AudioManagerCras::HasAudioOutputDevices() { | 25 bool AudioManagerCras::HasAudioOutputDevices() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 } | 75 } |
| 76 | 76 |
| 77 AudioInputStream* AudioManagerCras::MakeLowLatencyInputStream( | 77 AudioInputStream* AudioManagerCras::MakeLowLatencyInputStream( |
| 78 const AudioParameters& params, const std::string& device_id) { | 78 const AudioParameters& params, const std::string& device_id) { |
| 79 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 79 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
| 80 return MakeInputStream(params, device_id); | 80 return MakeInputStream(params, device_id); |
| 81 } | 81 } |
| 82 | 82 |
| 83 AudioOutputStream* AudioManagerCras::MakeOutputStream( | 83 AudioOutputStream* AudioManagerCras::MakeOutputStream( |
| 84 const AudioParameters& params) { | 84 const AudioParameters& params) { |
| 85 return new CrasOutputStream(params, this); | 85 return new CrasUnifiedStream(params, this); |
|
Chris Rogers
2013/02/21 18:17:26
For the moment, I think you'll need to put this be
dgreid
2013/02/22 02:09:35
the way I wired this up I'm going through the new
| |
| 86 } | 86 } |
| 87 | 87 |
| 88 AudioInputStream* AudioManagerCras::MakeInputStream( | 88 AudioInputStream* AudioManagerCras::MakeInputStream( |
| 89 const AudioParameters& params, const std::string& device_id) { | 89 const AudioParameters& params, const std::string& device_id) { |
| 90 return new CrasInputStream(params, this); | 90 return new CrasInputStream(params, this); |
| 91 } | 91 } |
| 92 | 92 |
| 93 AudioParameters AudioManagerCras::GetPreferredLowLatencyOutputStreamParameters( | 93 AudioParameters AudioManagerCras::GetPreferredLowLatencyOutputStreamParameters( |
| 94 const AudioParameters& input_params) { | 94 const AudioParameters& input_params) { |
| 95 // TODO(dalecurtis): This should include bits per channel and channel layout | 95 // TODO(dalecurtis): This should include bits per channel and channel layout |
| 96 // eventually. | 96 // eventually. |
| 97 return AudioParameters( | 97 return AudioParameters( |
| 98 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(), | 98 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(), |
| 99 input_params.sample_rate(), 16, input_params.frames_per_buffer()); | 99 input_params.sample_rate(), 16, input_params.frames_per_buffer()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace media | 102 } // namespace media |
| OLD | NEW |