OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Creates an audio output stream based on the PulseAudio asynchronous API. | 5 // Creates an audio output stream based on the PulseAudio asynchronous API. |
6 // | 6 // |
7 // If the stream is successfully opened, Close() must be called before the | 7 // If the stream is successfully opened, Close() must be called before the |
8 // stream is deleted as Close() is responsible for ensuring resource cleanup | 8 // stream is deleted as Close() is responsible for ensuring resource cleanup |
9 // occurs. | 9 // occurs. |
10 // | 10 // |
11 // This object is designed so that all AudioOutputStream methods will be called | 11 // This object is designed so that all AudioOutputStream methods will be called |
12 // on the same thread that created the object. | 12 // on the same thread that created the object. |
13 // | 13 // |
14 // WARNING: This object blocks on internal PulseAudio calls in Open() while | 14 // WARNING: This object blocks on internal PulseAudio calls in Open() while |
15 // waiting for PulseAudio's context structure to be ready. It also blocks in | 15 // waiting for PulseAudio's context structure to be ready. It also blocks in |
16 // inside PulseAudio in Start() and repeated during playback, waiting for | 16 // inside PulseAudio in Start() and repeated during playback, waiting for |
17 // PulseAudio write callbacks to occur. | 17 // PulseAudio write callbacks to occur. |
18 | 18 |
19 #ifndef MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ | 19 #ifndef MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ |
20 #define MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ | 20 #define MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ |
21 | 21 |
22 #include <pulse/pulseaudio.h> | 22 #include <pulse/pulseaudio.h> |
23 | 23 |
24 #include "base/memory/scoped_ptr.h" | 24 #include "base/memory/scoped_ptr.h" |
25 #include "base/memory/weak_ptr.h" | 25 #include "base/memory/weak_ptr.h" |
26 #include "base/task.h" | |
27 #include "media/audio/audio_io.h" | 26 #include "media/audio/audio_io.h" |
28 #include "media/base/channel_layout.h" | 27 #include "media/base/channel_layout.h" |
29 | 28 |
30 namespace media { | 29 namespace media { |
31 class SeekableBuffer; | 30 class SeekableBuffer; |
32 } | 31 } |
33 | 32 |
34 #if defined(OS_LINUX) | 33 #if defined(OS_LINUX) |
35 class AudioManagerLinux; | 34 class AudioManagerLinux; |
36 typedef AudioManagerLinux AudioManagerPulse; | 35 typedef AudioManagerLinux AudioManagerPulse; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // bound by its lifetime. | 124 // bound by its lifetime. |
126 base::WeakPtrFactory<PulseAudioOutputStream> weak_factory_; | 125 base::WeakPtrFactory<PulseAudioOutputStream> weak_factory_; |
127 | 126 |
128 // Callback to audio data source. | 127 // Callback to audio data source. |
129 AudioSourceCallback* source_callback_; | 128 AudioSourceCallback* source_callback_; |
130 | 129 |
131 DISALLOW_COPY_AND_ASSIGN(PulseAudioOutputStream); | 130 DISALLOW_COPY_AND_ASSIGN(PulseAudioOutputStream); |
132 }; | 131 }; |
133 | 132 |
134 #endif // MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ | 133 #endif // MEDIA_AUDIO_PULSE_PULSE_OUTPUT_H_ |
OLD | NEW |