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 20 matching lines...) Expand all Loading... |
31 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; | 31 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; |
32 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; | 32 void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; |
33 AudioParameters GetInputStreamParameters( | 33 AudioParameters GetInputStreamParameters( |
34 const std::string& device_id) override; | 34 const std::string& device_id) override; |
35 | 35 |
36 // Implementation of AudioManagerBase. | 36 // Implementation of AudioManagerBase. |
37 AudioOutputStream* MakeLinearOutputStream( | 37 AudioOutputStream* MakeLinearOutputStream( |
38 const AudioParameters& params) override; | 38 const AudioParameters& params) override; |
39 AudioOutputStream* MakeLowLatencyOutputStream( | 39 AudioOutputStream* MakeLowLatencyOutputStream( |
40 const AudioParameters& params, | 40 const AudioParameters& params, |
41 const std::string& device_id) override; | 41 const std::string& device_id, |
| 42 const StatisticsCallback& statistics_callback) override; |
42 AudioInputStream* MakeLinearInputStream( | 43 AudioInputStream* MakeLinearInputStream( |
43 const AudioParameters& params, | 44 const AudioParameters& params, |
44 const std::string& device_id) override; | 45 const std::string& device_id) override; |
45 AudioInputStream* MakeLowLatencyInputStream( | 46 AudioInputStream* MakeLowLatencyInputStream( |
46 const AudioParameters& params, | 47 const AudioParameters& params, |
47 const std::string& device_id) override; | 48 const std::string& device_id) override; |
48 | 49 |
49 protected: | 50 protected: |
50 ~AudioManagerPulse() override; | 51 ~AudioManagerPulse() override; |
51 | 52 |
(...skipping 15 matching lines...) Expand all Loading... |
67 const pa_sink_info* info, | 68 const pa_sink_info* info, |
68 int error, void* user_data); | 69 int error, void* user_data); |
69 | 70 |
70 // Callback to get the native sample rate of PulseAudio, used by | 71 // Callback to get the native sample rate of PulseAudio, used by |
71 // GetNativeSampleRate(). | 72 // GetNativeSampleRate(). |
72 static void SampleRateInfoCallback(pa_context* context, | 73 static void SampleRateInfoCallback(pa_context* context, |
73 const pa_server_info* info, | 74 const pa_server_info* info, |
74 void* user_data); | 75 void* user_data); |
75 | 76 |
76 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. | 77 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. |
77 AudioOutputStream* MakeOutputStream(const AudioParameters& params, | 78 AudioOutputStream* MakeOutputStream( |
78 const std::string& device_id); | 79 const AudioParameters& params, |
| 80 const std::string& device_id, |
| 81 const StatisticsCallback& statistics_callback); |
79 | 82 |
80 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. | 83 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. |
81 AudioInputStream* MakeInputStream(const AudioParameters& params, | 84 AudioInputStream* MakeInputStream(const AudioParameters& params, |
82 const std::string& device_id); | 85 const std::string& device_id); |
83 | 86 |
84 // Gets the native sample rate of Pulse. | 87 // Gets the native sample rate of Pulse. |
85 int GetNativeSampleRate(); | 88 int GetNativeSampleRate(); |
86 | 89 |
87 pa_threaded_mainloop* input_mainloop_; | 90 pa_threaded_mainloop* input_mainloop_; |
88 pa_context* input_context_; | 91 pa_context* input_context_; |
89 AudioDeviceNames* devices_; | 92 AudioDeviceNames* devices_; |
90 int native_input_sample_rate_; | 93 int native_input_sample_rate_; |
91 | 94 |
92 DISALLOW_COPY_AND_ASSIGN(AudioManagerPulse); | 95 DISALLOW_COPY_AND_ASSIGN(AudioManagerPulse); |
93 }; | 96 }; |
94 | 97 |
95 } // namespace media | 98 } // namespace media |
96 | 99 |
97 #endif // MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ | 100 #endif // MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ |
OLD | NEW |