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 #ifndef MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_ | 5 #ifndef MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_ |
6 #define MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_ | 6 #define MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_ |
7 | 7 |
8 #include <cras_types.h> | 8 #include <cras_types.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 const AudioParameters& params, | 44 const AudioParameters& params, |
45 const std::string& device_id, | 45 const std::string& device_id, |
46 const LogCallback& log_callback) override; | 46 const LogCallback& log_callback) override; |
47 AudioInputStream* MakeLowLatencyInputStream( | 47 AudioInputStream* MakeLowLatencyInputStream( |
48 const AudioParameters& params, | 48 const AudioParameters& params, |
49 const std::string& device_id, | 49 const std::string& device_id, |
50 const LogCallback& log_callback) override; | 50 const LogCallback& log_callback) override; |
51 | 51 |
52 static snd_pcm_format_t BitsToFormat(int bits_per_sample); | 52 static snd_pcm_format_t BitsToFormat(int bits_per_sample); |
53 | 53 |
| 54 // Checks if |device_id| corresponds to 'Default' |is_input| choice. |
| 55 bool IsDefault(const std::string& device_id, bool is_input); |
| 56 |
54 protected: | 57 protected: |
55 ~AudioManagerCras() override; | 58 ~AudioManagerCras() override; |
56 | 59 |
57 AudioParameters GetPreferredOutputStreamParameters( | 60 AudioParameters GetPreferredOutputStreamParameters( |
58 const std::string& output_device_id, | 61 const std::string& output_device_id, |
59 const AudioParameters& input_params) override; | 62 const AudioParameters& input_params) override; |
60 | 63 |
61 private: | 64 private: |
62 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. | 65 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. |
63 AudioOutputStream* MakeOutputStream(const AudioParameters& params); | 66 AudioOutputStream* MakeOutputStream(const AudioParameters& params, |
| 67 const std::string& device_id); |
64 | 68 |
65 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. | 69 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. |
66 AudioInputStream* MakeInputStream(const AudioParameters& params, | 70 AudioInputStream* MakeInputStream(const AudioParameters& params, |
67 const std::string& device_id); | 71 const std::string& device_id); |
68 | 72 |
69 void GetAudioDeviceNamesImpl(bool is_input, AudioDeviceNames* device_names); | 73 void GetAudioDeviceNamesImpl(bool is_input, AudioDeviceNames* device_names); |
70 | 74 |
71 void AddBeamformingDevices(AudioDeviceNames* device_names); | 75 void AddBeamformingDevices(AudioDeviceNames* device_names); |
72 | 76 |
73 // Stores the mic positions field from the device. | 77 // Stores the mic positions field from the device. |
74 std::vector<Point> mic_positions_; | 78 std::vector<Point> mic_positions_; |
75 | 79 |
76 const char* beamforming_on_device_id_; | 80 const char* beamforming_on_device_id_; |
77 const char* beamforming_off_device_id_; | 81 const char* beamforming_off_device_id_; |
78 | 82 |
79 DISALLOW_COPY_AND_ASSIGN(AudioManagerCras); | 83 DISALLOW_COPY_AND_ASSIGN(AudioManagerCras); |
80 }; | 84 }; |
81 | 85 |
82 } // namespace media | 86 } // namespace media |
83 | 87 |
84 #endif // MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_ | 88 #endif // MEDIA_AUDIO_CRAS_AUDIO_MANAGER_CRAS_H_ |
OLD | NEW |