| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 51 |
| 52 // Create a recording stream for the threaded mainloop, return true if success, | 52 // 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 | 53 // 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 | 54 // threaded mainloop and the handle of the created stream will be returned by |
| 55 // |stream|. | 55 // |stream|. |
| 56 // TODO(grunell): Move this function to PulseAudioInputStream class since it's | |
| 57 // only used there. | |
| 58 bool CreateInputStream(pa_threaded_mainloop* mainloop, | 56 bool CreateInputStream(pa_threaded_mainloop* mainloop, |
| 59 pa_context* context, | 57 pa_context* context, |
| 60 pa_stream** stream, | 58 pa_stream** stream, |
| 61 const AudioParameters& params, | 59 const AudioParameters& params, |
| 62 const std::string& device_id, | 60 const std::string& device_id, |
| 63 pa_stream_notify_cb_t stream_callback, | 61 pa_stream_notify_cb_t stream_callback, |
| 64 void* user_data); | 62 void* user_data); |
| 65 | 63 |
| 66 // Create a playback stream for the threaded mainloop, return true if success, | 64 // Create a playback stream for the threaded mainloop, return true if success, |
| 67 // otherwise false. This function will create a new Pulse threaded mainloop, | 65 // otherwise false. This function will create a new Pulse threaded mainloop, |
| 68 // and the handles of the mainloop, context and stream will be returned by | 66 // and the handles of the mainloop, context and stream will be returned by |
| 69 // |mainloop|, |context| and |stream|. | 67 // |mainloop|, |context| and |stream|. |
| 70 // TODO(grunell): Move this function to PulseAudioOutputStream class since it's | 68 bool CreateOutputStream(pa_threaded_mainloop** mainloop, |
| 71 // only used there. | 69 pa_context** context, |
| 72 bool CreateOutputStream(pa_threaded_mainloop* mainloop, | |
| 73 pa_context* context, | |
| 74 pa_stream** stream, | 70 pa_stream** stream, |
| 75 const AudioParameters& params, | 71 const AudioParameters& params, |
| 76 const std::string& device_id, | 72 const std::string& device_id, |
| 77 const std::string& app_name, | 73 const std::string& app_name, |
| 78 pa_stream_notify_cb_t stream_callback, | 74 pa_stream_notify_cb_t stream_callback, |
| 79 pa_stream_request_cb_t write_callback, | 75 pa_stream_request_cb_t write_callback, |
| 80 void* user_data); | 76 void* user_data); |
| 81 | 77 |
| 82 } // namespace pulse | 78 } // namespace pulse |
| 83 | 79 |
| 84 } // namespace media | 80 } // namespace media |
| 85 | 81 |
| 86 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ | 82 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ |
| OLD | NEW |