| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Define bounds for the output buffer size. | 43 // Define bounds for the output buffer size. |
| 44 const int kMinimumOutputBufferSize = 512; | 44 const int kMinimumOutputBufferSize = 512; |
| 45 const int kMaximumOutputBufferSize = 8192; | 45 const int kMaximumOutputBufferSize = 8192; |
| 46 | 46 |
| 47 // Default input buffer size. | 47 // Default input buffer size. |
| 48 const int kDefaultInputBufferSize = 1024; | 48 const int kDefaultInputBufferSize = 1024; |
| 49 | 49 |
| 50 const char kBeamformingOnDeviceId[] = "default-beamforming-on"; | 50 const char kBeamformingOnDeviceId[] = "default-beamforming-on"; |
| 51 const char kBeamformingOffDeviceId[] = "default-beamforming-off"; | 51 const char kBeamformingOffDeviceId[] = "default-beamforming-off"; |
| 52 | 52 |
| 53 const char kInternalInputDevice[] = "Built-in-mic"; | 53 const char kInternalInputDevice[] = "Built-in mic"; |
| 54 const char kInternalOutputDevice[] = "Built-in-speaker"; | 54 const char kInternalOutputDevice[] = "Built-in speaker"; |
| 55 | 55 |
| 56 enum CrosBeamformingDeviceState { | 56 enum CrosBeamformingDeviceState { |
| 57 BEAMFORMING_DEFAULT_ENABLED = 0, | 57 BEAMFORMING_DEFAULT_ENABLED = 0, |
| 58 BEAMFORMING_USER_ENABLED, | 58 BEAMFORMING_USER_ENABLED, |
| 59 BEAMFORMING_DEFAULT_DISABLED, | 59 BEAMFORMING_DEFAULT_DISABLED, |
| 60 BEAMFORMING_USER_DISABLED, | 60 BEAMFORMING_USER_DISABLED, |
| 61 BEAMFORMING_STATE_MAX = BEAMFORMING_USER_DISABLED | 61 BEAMFORMING_STATE_MAX = BEAMFORMING_USER_DISABLED |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 void RecordBeamformingDeviceState(CrosBeamformingDeviceState state) { | 64 void RecordBeamformingDeviceState(CrosBeamformingDeviceState state) { |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 bool AudioManagerCras::IsDefault(const std::string& device_id, bool is_input) { | 360 bool AudioManagerCras::IsDefault(const std::string& device_id, bool is_input) { |
| 361 AudioDeviceNames device_names; | 361 AudioDeviceNames device_names; |
| 362 GetAudioDeviceNamesImpl(is_input, &device_names); | 362 GetAudioDeviceNamesImpl(is_input, &device_names); |
| 363 DCHECK(!device_names.empty()); | 363 DCHECK(!device_names.empty()); |
| 364 const AudioDeviceName& device_name = device_names.front(); | 364 const AudioDeviceName& device_name = device_names.front(); |
| 365 return device_name.unique_id == device_id; | 365 return device_name.unique_id == device_id; |
| 366 } | 366 } |
| 367 | 367 |
| 368 } // namespace media | 368 } // namespace media |
| OLD | NEW |