OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
| 6 #define MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
| 7 |
| 8 #include <pulse/pulseaudio.h> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "media/audio/audio_device_name.h" |
| 12 //#include "media/audio/pulse/pulse_wrapper.h" |
| 13 #include "media/base/channel_layout.h" |
| 14 |
| 15 namespace media { |
| 16 |
| 17 class PulseWrapper; |
| 18 |
| 19 // A helper class that acquires pa_threaded_mainloop_lock() while in scope. |
| 20 class AutoPulseLock { |
| 21 public: |
| 22 AutoPulseLock(PulseWrapper* wrapper, pa_threaded_mainloop* pa_mainloop); |
| 23 ~AutoPulseLock(); |
| 24 |
| 25 private: |
| 26 PulseWrapper* wrapper_; |
| 27 pa_threaded_mainloop* pa_mainloop_; |
| 28 DISALLOW_COPY_AND_ASSIGN(AutoPulseLock); |
| 29 }; |
| 30 |
| 31 pa_sample_format_t BitsToPASampleFormat(PulseWrapper* wrapper, |
| 32 int bits_per_sample); |
| 33 |
| 34 pa_channel_map ChannelLayoutToPAChannelMap(PulseWrapper* wrapper, |
| 35 ChannelLayout channel_layout); |
| 36 |
| 37 void WaitForOperationCompletion(PulseWrapper* wrapper, |
| 38 pa_threaded_mainloop* pa_mainloop, |
| 39 pa_operation* operation); |
| 40 |
| 41 int GetHardwareLatencyInBytes(PulseWrapper* wrapper, |
| 42 pa_stream* stream, |
| 43 int sample_rate, |
| 44 int bytes_per_frame); |
| 45 |
| 46 } // namespace media |
| 47 |
| 48 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
OLD | NEW |