Chromium Code Reviews| 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_UTIL_H_ | 5 #ifndef MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
| 6 #define MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ | 6 #define MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
| 7 | 7 |
| 8 #include <pulse/pulseaudio.h> | 8 #include <pulse/pulseaudio.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample); | 41 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample); |
| 42 | 42 |
| 43 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout); | 43 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout); |
| 44 | 44 |
| 45 void WaitForOperationCompletion(pa_threaded_mainloop* mainloop, | 45 void WaitForOperationCompletion(pa_threaded_mainloop* mainloop, |
| 46 pa_operation* operation); | 46 pa_operation* operation); |
| 47 | 47 |
| 48 int GetHardwareLatencyInBytes(pa_stream* stream, | 48 int GetHardwareLatencyInBytes(pa_stream* stream, |
| 49 int sample_rate, | 49 int sample_rate, |
| 50 int bytes_per_frame); | 50 int bytes_per_frame); |
| 51 | |
| 52 // Create a recording stream for the threaded mainloop, return true if success, | 51 // Create a recording stream for the threaded mainloop, return true if success, |
| 53 // otherwise false. |mainloop| and |context| have to be from a valid Pulse | 52 // otherwise false. |mainloop| and |context| have to be from a valid Pulse |
| 54 // threaded mainloop and the handle of the created stream will be returned by | 53 // threaded mainloop and the handle of the created stream will be returned by |
| 55 // |stream|. | 54 // |stream|. |
| 55 // TODO: Move this function to PulseAudioInputStream class since it's only | |
|
Henrik Grunell
2016/03/09 00:49:17
"TODO:" -> "TODO(grunell):". Ditto below.
rchtara
2016/03/09 16:16:10
Done.
| |
| 56 // used there. | |
| 56 bool CreateInputStream(pa_threaded_mainloop* mainloop, | 57 bool CreateInputStream(pa_threaded_mainloop* mainloop, |
| 57 pa_context* context, | 58 pa_context* context, |
| 58 pa_stream** stream, | 59 pa_stream** stream, |
| 59 const AudioParameters& params, | 60 const AudioParameters& params, |
| 60 const std::string& device_id, | 61 const std::string& device_id, |
| 61 pa_stream_notify_cb_t stream_callback, | 62 pa_stream_notify_cb_t stream_callback, |
| 62 void* user_data); | 63 void* user_data); |
| 63 | 64 |
| 64 // Create a playback stream for the threaded mainloop, return true if success, | 65 // Create a playback stream for the threaded mainloop, return true if success, |
| 65 // otherwise false. This function will create a new Pulse threaded mainloop, | 66 // otherwise false. This function will create a new Pulse threaded mainloop, |
| 66 // and the handles of the mainloop, context and stream will be returned by | 67 // and the handles of the mainloop, context and stream will be returned by |
| 67 // |mainloop|, |context| and |stream|. | 68 // |mainloop|, |context| and |stream|. |
| 68 bool CreateOutputStream(pa_threaded_mainloop** mainloop, | 69 // TODO: Move this function to PulseAudioOutputStream class since it's only |
| 69 pa_context** context, | 70 // used there. |
| 71 bool CreateOutputStream(pa_threaded_mainloop* mainloop, | |
| 72 pa_context* context, | |
| 70 pa_stream** stream, | 73 pa_stream** stream, |
| 71 const AudioParameters& params, | 74 const AudioParameters& params, |
| 72 const std::string& device_id, | 75 const std::string& device_id, |
| 73 const std::string& app_name, | 76 const std::string& app_name, |
| 74 pa_stream_notify_cb_t stream_callback, | 77 pa_stream_notify_cb_t stream_callback, |
| 75 pa_stream_request_cb_t write_callback, | 78 pa_stream_request_cb_t write_callback, |
| 76 void* user_data); | 79 void* user_data); |
| 77 | 80 |
| 78 } // namespace pulse | 81 } // namespace pulse |
| 79 | 82 |
| 80 } // namespace media | 83 } // namespace media |
| 81 | 84 |
| 82 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ | 85 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
| OLD | NEW |