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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const pa_sink_info* info, | 62 const pa_sink_info* info, |
63 int error, void* user_data); | 63 int error, void* user_data); |
64 | 64 |
65 // Callback to get the native sample rate of PulseAudio, used by | 65 // Callback to get the native sample rate of PulseAudio, used by |
66 // GetNativeSampleRate(). | 66 // GetNativeSampleRate(). |
67 static void SampleRateInfoCallback(pa_context* context, | 67 static void SampleRateInfoCallback(pa_context* context, |
68 const pa_server_info* info, | 68 const pa_server_info* info, |
69 void* user_data); | 69 void* user_data); |
70 | 70 |
71 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. | 71 // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. |
72 AudioOutputStream* MakeOutputStream(const AudioParameters& params); | 72 AudioOutputStream* MakeOutputStream(const AudioParameters& params, |
| 73 const std::string& device_id); |
73 | 74 |
74 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. | 75 // Called by MakeLinearInputStream and MakeLowLatencyInputStream. |
75 AudioInputStream* MakeInputStream(const AudioParameters& params, | 76 AudioInputStream* MakeInputStream(const AudioParameters& params, |
76 const std::string& device_id); | 77 const std::string& device_id); |
77 | 78 |
78 // Gets the native sample rate of Pulse. | 79 // Gets the native sample rate of Pulse. |
79 int GetNativeSampleRate(); | 80 int GetNativeSampleRate(); |
80 | 81 |
81 pa_threaded_mainloop* input_mainloop_; | 82 pa_threaded_mainloop* input_mainloop_; |
82 pa_context* input_context_; | 83 pa_context* input_context_; |
83 AudioDeviceNames* devices_; | 84 AudioDeviceNames* devices_; |
84 int native_input_sample_rate_; | 85 int native_input_sample_rate_; |
85 | 86 |
86 DISALLOW_COPY_AND_ASSIGN(AudioManagerPulse); | 87 DISALLOW_COPY_AND_ASSIGN(AudioManagerPulse); |
87 }; | 88 }; |
88 | 89 |
89 } // namespace media | 90 } // namespace media |
90 | 91 |
91 #endif // MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ | 92 #endif // MEDIA_AUDIO_PULSE_AUDIO_MANAGER_PULSE_H_ |
OLD | NEW |