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