Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Side by Side Diff: media/audio/pulse/pulse_util.h

Issue 2689483006: Switch browser side audio capture path to use base time primitives. (Closed)
Patch Set: Bloop Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 10 #include <string>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample); 44 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample);
45 45
46 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout); 46 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout);
47 47
48 void WaitForOperationCompletion(pa_threaded_mainloop* mainloop, 48 void WaitForOperationCompletion(pa_threaded_mainloop* mainloop,
49 pa_operation* operation); 49 pa_operation* operation);
50 50
51 base::TimeDelta GetHardwareLatency(pa_stream* stream); 51 base::TimeDelta GetHardwareLatency(pa_stream* stream);
52 52
53 int GetHardwareLatencyInBytes(pa_stream* stream,
54 int sample_rate,
55 int bytes_per_frame);
56
57 // Create a recording stream for the threaded mainloop, return true if success, 53 // Create a recording stream for the threaded mainloop, return true if success,
58 // otherwise false. |mainloop| and |context| have to be from a valid Pulse 54 // otherwise false. |mainloop| and |context| have to be from a valid Pulse
59 // threaded mainloop and the handle of the created stream will be returned by 55 // threaded mainloop and the handle of the created stream will be returned by
60 // |stream|. 56 // |stream|.
61 bool CreateInputStream(pa_threaded_mainloop* mainloop, 57 bool CreateInputStream(pa_threaded_mainloop* mainloop,
62 pa_context* context, 58 pa_context* context,
63 pa_stream** stream, 59 pa_stream** stream,
64 const AudioParameters& params, 60 const AudioParameters& params,
65 const std::string& device_id, 61 const std::string& device_id,
66 pa_stream_notify_cb_t stream_callback, 62 pa_stream_notify_cb_t stream_callback,
(...skipping 11 matching lines...) Expand all
78 const std::string& app_name, 74 const std::string& app_name,
79 pa_stream_notify_cb_t stream_callback, 75 pa_stream_notify_cb_t stream_callback,
80 pa_stream_request_cb_t write_callback, 76 pa_stream_request_cb_t write_callback,
81 void* user_data); 77 void* user_data);
82 78
83 } // namespace pulse 79 } // namespace pulse
84 80
85 } // namespace media 81 } // namespace media
86 82
87 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ 83 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698