| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PULSE_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ |
| 6 #define MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ | 6 #define MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ |
| 7 | 7 |
| 8 #include <pulse/pulseaudio.h> | 8 #include <pulse/pulseaudio.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
| 14 #include "media/audio/agc_audio_stream.h" | 14 #include "media/audio/agc_audio_stream.h" |
| 15 #include "media/audio/audio_device_name.h" | 15 #include "media/audio/audio_device_name.h" |
| 16 #include "media/audio/audio_io.h" | 16 #include "media/audio/audio_io.h" |
| 17 #include "media/audio/audio_parameters.h" | 17 #include "media/audio/audio_parameters.h" |
| 18 #include "media/audio/pulse/pulse_util.h" |
| 18 #include "media/base/audio_block_fifo.h" | 19 #include "media/base/audio_block_fifo.h" |
| 19 | 20 |
| 20 namespace media { | 21 namespace media { |
| 21 | 22 |
| 22 class AudioManagerPulse; | 23 class AudioManagerPulse; |
| 23 | 24 |
| 24 class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> { | 25 class PulseAudioInputStream : public AgcAudioStream<AudioInputStream> { |
| 25 public: | 26 public: |
| 26 PulseAudioInputStream(AudioManagerPulse* audio_manager, | 27 PulseAudioInputStream(AudioManagerPulse* audio_manager, |
| 27 const std::string& device_name, | 28 const std::string& device_name, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 AudioBlockFifo fifo_; | 75 AudioBlockFifo fifo_; |
| 75 | 76 |
| 76 // PulseAudio API structs. | 77 // PulseAudio API structs. |
| 77 pa_threaded_mainloop* pa_mainloop_; // Weak. | 78 pa_threaded_mainloop* pa_mainloop_; // Weak. |
| 78 pa_context* pa_context_; // Weak. | 79 pa_context* pa_context_; // Weak. |
| 79 pa_stream* handle_; | 80 pa_stream* handle_; |
| 80 | 81 |
| 81 base::ThreadChecker thread_checker_; | 82 base::ThreadChecker thread_checker_; |
| 82 | 83 |
| 83 DISALLOW_COPY_AND_ASSIGN(PulseAudioInputStream); | 84 DISALLOW_COPY_AND_ASSIGN(PulseAudioInputStream); |
| 85 friend void pulse::SystemDefaultInputDeviceCallback( |
| 86 pa_context* context, |
| 87 const pa_server_info* info, |
| 88 void* user_data); |
| 89 friend std::string pulse::GetSystemDefaultInputDevice( |
| 90 pa_threaded_mainloop* mainloop, |
| 91 pa_context* context); |
| 92 friend void pulse::SystemDefaultOutputDeviceCallback( |
| 93 pa_context* context, |
| 94 const pa_server_info* info, |
| 95 void* user_data); |
| 96 friend std::string pulse::GetSystemDefaultOutputDevice( |
| 97 pa_threaded_mainloop* mainloop, |
| 98 pa_context* context); |
| 84 }; | 99 }; |
| 85 | 100 |
| 86 } // namespace media | 101 } // namespace media |
| 87 | 102 |
| 88 #endif // MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ | 103 #endif // MEDIA_AUDIO_PULSE_PULSE_INPUT_H_ |
| OLD | NEW |