OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 output stream based on the ALSA PCM interface. | 5 // Creates an output stream based on the ALSA PCM interface. |
6 // | 6 // |
7 // On device write failure, the stream will move itself to an invalid state. | 7 // On device write failure, the stream will move itself to an invalid state. |
8 // No more data will be pulled from the data source, or written to the device. | 8 // No more data will be pulled from the data source, or written to the device. |
9 // All calls to public API functions will either no-op themselves, or return an | 9 // All calls to public API functions will either no-op themselves, or return an |
10 // error if possible. Specifically, If the stream is in an error state, Open() | 10 // error if possible. Specifically, If the stream is in an error state, Open() |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 // Flags indicating the state of the stream. | 127 // Flags indicating the state of the stream. |
128 enum InternalState { | 128 enum InternalState { |
129 kInError = 0, | 129 kInError = 0, |
130 kCreated, | 130 kCreated, |
131 kIsOpened, | 131 kIsOpened, |
132 kIsPlaying, | 132 kIsPlaying, |
133 kIsStopped, | 133 kIsStopped, |
134 kIsClosed | 134 kIsClosed |
135 }; | 135 }; |
136 friend std::ostream& ::operator<<(std::ostream& os, InternalState); | 136 friend std::ostream& operator<<(std::ostream& os, InternalState); |
137 | 137 |
138 // Various tasks that complete actions started in the public API. | 138 // Various tasks that complete actions started in the public API. |
139 void OpenTask(uint32 packet_size); | 139 void OpenTask(uint32 packet_size); |
140 void StartTask(); | 140 void StartTask(); |
141 void CloseTask(); | 141 void CloseTask(); |
142 | 142 |
143 // Functions to get another packet from the data source and write it into the | 143 // Functions to get another packet from the data source and write it into the |
144 // ALSA device. | 144 // ALSA device. |
145 void BufferPacket(Packet* packet); | 145 void BufferPacket(Packet* packet); |
146 void WritePacket(Packet* packet); | 146 void WritePacket(Packet* packet); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 MessageLoop* client_thread_loop_; | 251 MessageLoop* client_thread_loop_; |
252 | 252 |
253 // The message loop responsible for querying the data source, and writing to | 253 // The message loop responsible for querying the data source, and writing to |
254 // the output device. | 254 // the output device. |
255 MessageLoop* message_loop_; | 255 MessageLoop* message_loop_; |
256 | 256 |
257 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream); | 257 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream); |
258 }; | 258 }; |
259 | 259 |
260 #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_ | 260 #endif // MEDIA_AUDIO_LINUX_ALSA_OUTPUT_H_ |
OLD | NEW |