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

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

Issue 10952024: Adding pulseaudio input support to chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and addressed Dale's final comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/pulse/pulse_stub_header.fragment ('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
(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/base/channel_layout.h"
13
14 namespace media {
15
16 namespace pulse {
17
18 // A helper class that acquires pa_threaded_mainloop_lock() while in scope.
19 class AutoPulseLock {
20 public:
21 explicit AutoPulseLock(pa_threaded_mainloop* pa_mainloop)
22 : pa_mainloop_(pa_mainloop) {
23 pa_threaded_mainloop_lock(pa_mainloop_);
24 }
25
26 ~AutoPulseLock() {
27 pa_threaded_mainloop_unlock(pa_mainloop_);
28 }
29
30 private:
31 pa_threaded_mainloop* pa_mainloop_;
32 DISALLOW_COPY_AND_ASSIGN(AutoPulseLock);
33 };
34
35 // Triggers pa_threaded_mainloop_signal() to avoid deadlocks.
36 void StreamSuccessCallback(pa_stream* s, int error, void* mainloop);
37 void ContextStateCallback(pa_context* context, void* mainloop);
38
39 pa_sample_format_t BitsToPASampleFormat(int bits_per_sample);
40
41 pa_channel_map ChannelLayoutToPAChannelMap(ChannelLayout channel_layout);
42
43 void WaitForOperationCompletion(pa_threaded_mainloop* pa_mainloop,
44 pa_operation* operation);
45
46 int GetHardwareLatencyInBytes(pa_stream* stream,
47 int sample_rate,
48 int bytes_per_frame);
49
50 } // namespace pulse
51
52 } // namespace media
53
54 #endif // MEDIA_AUDIO_PULSE_PULSE_UTIL_H_
OLDNEW
« no previous file with comments | « media/audio/pulse/pulse_stub_header.fragment ('k') | media/audio/pulse/pulse_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698