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

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

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/audio/pulse/pulse_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19 matching lines...) Expand all
30 30
31 ~AutoPulseLock() { 31 ~AutoPulseLock() {
32 pa_threaded_mainloop_unlock(pa_mainloop_); 32 pa_threaded_mainloop_unlock(pa_mainloop_);
33 } 33 }
34 34
35 private: 35 private:
36 pa_threaded_mainloop* pa_mainloop_; 36 pa_threaded_mainloop* pa_mainloop_;
37 DISALLOW_COPY_AND_ASSIGN(AutoPulseLock); 37 DISALLOW_COPY_AND_ASSIGN(AutoPulseLock);
38 }; 38 };
39 39
40 bool MEDIA_EXPORT InitPulse(pa_threaded_mainloop** mainloop,
41 pa_context** context);
42 void DestroyPulse(pa_threaded_mainloop* mainloop, pa_context* context);
43
40 // Triggers pa_threaded_mainloop_signal() to avoid deadlocks. 44 // Triggers pa_threaded_mainloop_signal() to avoid deadlocks.
41 void StreamSuccessCallback(pa_stream* s, int error, void* mainloop); 45 void StreamSuccessCallback(pa_stream* s, int error, void* mainloop);
42 void ContextStateCallback(pa_context* context, void* mainloop); 46 void ContextStateCallback(pa_context* context, void* mainloop);
43 47
44 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample); 48 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample);
45 49
46 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout); 50 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout);
47 51
48 void WaitForOperationCompletion(pa_threaded_mainloop* mainloop, 52 void WaitForOperationCompletion(pa_threaded_mainloop* mainloop,
49 pa_operation* operation); 53 pa_operation* operation);
(...skipping 28 matching lines...) Expand all
78 const std::string& app_name, 82 const std::string& app_name,
79 pa_stream_notify_cb_t stream_callback, 83 pa_stream_notify_cb_t stream_callback,
80 pa_stream_request_cb_t write_callback, 84 pa_stream_request_cb_t write_callback,
81 void* user_data); 85 void* user_data);
82 86
83 } // namespace pulse 87 } // namespace pulse
84 88
85 } // namespace media 89 } // namespace media
86 90
87 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_ 91 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_
OLDNEW
« no previous file with comments | « media/audio/pulse/audio_manager_pulse.cc ('k') | media/audio/pulse/pulse_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698