| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 bool AudioManagerCras::HasAudioInputDevices() { | 128 bool AudioManagerCras::HasAudioInputDevices() { |
| 129 chromeos::AudioDeviceList devices; | 129 chromeos::AudioDeviceList devices; |
| 130 chromeos::CrasAudioHandler::Get()->GetAudioDevices(&devices); | 130 chromeos::CrasAudioHandler::Get()->GetAudioDevices(&devices); |
| 131 for (size_t i = 0; i < devices.size(); ++i) { | 131 for (size_t i = 0; i < devices.size(); ++i) { |
| 132 if (devices[i].is_input && devices[i].is_for_simple_usage()) | 132 if (devices[i].is_input && devices[i].is_for_simple_usage()) |
| 133 return true; | 133 return true; |
| 134 } | 134 } |
| 135 return false; | 135 return false; |
| 136 } | 136 } |
| 137 | 137 |
| 138 AudioManagerCras::AudioManagerCras(AudioLogFactory* audio_log_factory) | 138 AudioManagerCras::AudioManagerCras( |
| 139 : AudioManagerBase(audio_log_factory), | 139 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 140 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, |
| 141 AudioLogFactory* audio_log_factory) |
| 142 : AudioManagerBase(std::move(task_runner), |
| 143 std::move(worker_task_runner), |
| 144 audio_log_factory), |
| 140 beamforming_on_device_id_(nullptr), | 145 beamforming_on_device_id_(nullptr), |
| 141 beamforming_off_device_id_(nullptr) { | 146 beamforming_off_device_id_(nullptr) { |
| 142 SetMaxOutputStreamsAllowed(kMaxOutputStreams); | 147 SetMaxOutputStreamsAllowed(kMaxOutputStreams); |
| 143 } | 148 } |
| 144 | 149 |
| 145 AudioManagerCras::~AudioManagerCras() { | 150 AudioManagerCras::~AudioManagerCras() {} |
| 146 Shutdown(); | |
| 147 } | |
| 148 | 151 |
| 149 void AudioManagerCras::ShowAudioInputSettings() { | 152 void AudioManagerCras::ShowAudioInputSettings() { |
| 150 NOTIMPLEMENTED(); | 153 NOTIMPLEMENTED(); |
| 151 } | 154 } |
| 152 | 155 |
| 153 void AudioManagerCras::GetAudioInputDeviceNames( | 156 void AudioManagerCras::GetAudioInputDeviceNames( |
| 154 AudioDeviceNames* device_names) { | 157 AudioDeviceNames* device_names) { |
| 155 DCHECK(device_names->empty()); | 158 DCHECK(device_names->empty()); |
| 156 | 159 |
| 157 mic_positions_ = ParsePointsFromString(MicPositions()); | 160 mic_positions_ = ParsePointsFromString(MicPositions()); |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 case 24: | 288 case 24: |
| 286 return SND_PCM_FORMAT_S24; | 289 return SND_PCM_FORMAT_S24; |
| 287 case 32: | 290 case 32: |
| 288 return SND_PCM_FORMAT_S32; | 291 return SND_PCM_FORMAT_S32; |
| 289 default: | 292 default: |
| 290 return SND_PCM_FORMAT_UNKNOWN; | 293 return SND_PCM_FORMAT_UNKNOWN; |
| 291 } | 294 } |
| 292 } | 295 } |
| 293 | 296 |
| 294 } // namespace media | 297 } // namespace media |
| OLD | NEW |