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 #ifndef MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ | 5 #ifndef MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ |
| 6 #define MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ | 6 #define MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ |
| 7 | 7 |
| 8 #include <pulse/pulseaudio.h> | 8 #include <pulse/pulseaudio.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 | 65 |
| 66 // Callback to get the devices' info like names, used by GetInputDevices(). | 66 // Callback to get the devices' info like names, used by GetInputDevices(). |
| 67 static void InputDevicesInfoCallback(pa_context* context, | 67 static void InputDevicesInfoCallback(pa_context* context, |
| 68 const pa_source_info* info, | 68 const pa_source_info* info, |
| 69 int error, void* user_data); | 69 int error, void* user_data); |
| 70 static void OutputDevicesInfoCallback(pa_context* context, | 70 static void OutputDevicesInfoCallback(pa_context* context, |
| 71 const pa_sink_info* info, | 71 const pa_sink_info* info, |
| 72 int error, void* user_data); | 72 int error, void* user_data); |
| 73 | 73 |
| 74 // Callback to get the native sample rate of PulseAudio, used by | 74 // Callback to get the native sample rate of PulseAudio, used by |
| 75 // GetNativeSampleRate(). | 75 // GetNativeSampleRate(). |
|
watk
2016/09/15 21:21:52
comment is out of date
DaleCurtis
2016/09/15 21:35:49
Fixed.
| |
| 76 static void SampleRateInfoCallback(pa_context* context, | 76 static void AudioHardwareInfoCallback(pa_context* context, |
| 77 const pa_server_info* info, | 77 const pa_server_info* info, |
| 78 void* user_data); | 78 void* user_data); |
| 79 | 79 |
| 80 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. | 80 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. |
| 81 AudioOutputStream* MakeOutputStream(const AudioParameters& params, | 81 AudioOutputStream* MakeOutputStream(const AudioParameters& params, |
| 82 const std::string& device_id); | 82 const std::string& device_id); |
| 83 | 83 |
| 84 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. | 84 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. |
| 85 AudioInputStream* MakeInputStream(const AudioParameters& params, | 85 AudioInputStream* MakeInputStream(const AudioParameters& params, |
| 86 const std::string& device_id); | 86 const std::string& device_id); |
| 87 | 87 |
| 88 // Gets the native sample rate of Pulse. | 88 // Updates |native_input_sample_rate_| and |native_channel_count_|. |
| 89 int GetNativeSampleRate(); | 89 void UpdateNativeAudioHardwareInfo(); |
| 90 | 90 |
| 91 pa_threaded_mainloop* input_mainloop_; | 91 pa_threaded_mainloop* input_mainloop_; |
| 92 pa_context* input_context_; | 92 pa_context* input_context_; |
| 93 AudioDeviceNames* devices_; | 93 AudioDeviceNames* devices_; |
| 94 int native_input_sample_rate_; | 94 int native_input_sample_rate_; |
| 95 int native_channel_count_; | |
| 95 | 96 |
| 96 DISALLOW_COPY_AND_ASSIGN(AudioManagerPulse); | 97 DISALLOW_COPY_AND_ASSIGN(AudioManagerPulse); |
| 97 }; | 98 }; |
| 98 | 99 |
| 99 } // namespace media | 100 } // namespace media |
| 100 | 101 |
| 101 #endif // MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ | 102 #endif // MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ |
| OLD | NEW |