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