| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 InternalState state(); | 145 InternalState state(); |
| 146 | 146 |
| 147 // API for Proxying calls to the AudioSourceCallback provided during | 147 // API for Proxying calls to the AudioSourceCallback provided during |
| 148 // Start(). | 148 // Start(). |
| 149 // | 149 // |
| 150 // TODO(ajwong): This is necessary because the ownership semantics for the | 150 // TODO(ajwong): This is necessary because the ownership semantics for the |
| 151 // |source_callback_| object are incorrect in AudioRenderHost. The callback | 151 // |source_callback_| object are incorrect in AudioRenderHost. The callback |
| 152 // is passed into the output stream, but ownership is not transfered which | 152 // is passed into the output stream, but ownership is not transfered which |
| 153 // requires a synchronization on access of the |source_callback_| to avoid | 153 // requires a synchronization on access of the |source_callback_| to avoid |
| 154 // using a deleted callback. | 154 // using a deleted callback. |
| 155 int RunDataCallback(AudioBus* audio_bus, uint32_t total_bytes_delay); | 155 int RunDataCallback(base::TimeTicks target_playout_time, AudioBus* audio_bus); |
| 156 void RunErrorCallback(int code); | 156 void RunErrorCallback(int code); |
| 157 | 157 |
| 158 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to | 158 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to |
| 159 // release ownership of the currently registered callback. | 159 // release ownership of the currently registered callback. |
| 160 void set_source_callback(AudioSourceCallback* callback); | 160 void set_source_callback(AudioSourceCallback* callback); |
| 161 | 161 |
| 162 // Configuration constants from the constructor. Referenceable by all threads | 162 // Configuration constants from the constructor. Referenceable by all threads |
| 163 // since they are constants. | 163 // since they are constants. |
| 164 const std::string requested_device_name_; | 164 const std::string requested_device_name_; |
| 165 const snd_pcm_format_t pcm_format_; | 165 const snd_pcm_format_t pcm_format_; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream); | 216 DISALLOW_COPY_AND_ASSIGN(AlsaPcmOutputStream); |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 MEDIA_EXPORT std::ostream& operator<<(std::ostream& os, | 219 MEDIA_EXPORT std::ostream& operator<<(std::ostream& os, |
| 220 AlsaPcmOutputStream::InternalState); | 220 AlsaPcmOutputStream::InternalState); |
| 221 | 221 |
| 222 }; // namespace media | 222 }; // namespace media |
| 223 | 223 |
| 224 #endif // MEDIA_AUDIO_ALSA_ALSA_OUTPUT_H_ | 224 #endif // MEDIA_AUDIO_ALSA_ALSA_OUTPUT_H_ |
| OLD | NEW |