OLD | NEW |
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 // AudioRendererAlgorithm buffers and transforms audio data. The owner of | 5 // AudioRendererAlgorithm buffers and transforms audio data. The owner of |
6 // this object provides audio data to the object through EnqueueBuffer() and | 6 // this object provides audio data to the object through EnqueueBuffer() and |
7 // requests data from the buffer via FillBuffer(). | 7 // requests data from the buffer via FillBuffer(). |
8 // | 8 // |
9 // This class is *not* thread-safe. Calls to enqueue and retrieve data must be | 9 // This class is *not* thread-safe. Calls to enqueue and retrieve data must be |
10 // locked if called from multiple threads. | 10 // locked if called from multiple threads. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // Converts a time in milliseconds to frames using |samples_per_second_|. | 128 // Converts a time in milliseconds to frames using |samples_per_second_|. |
129 int ConvertMillisecondsToFrames(int ms) const; | 129 int ConvertMillisecondsToFrames(int ms) const; |
130 | 130 |
131 // Number of channels in audio stream. | 131 // Number of channels in audio stream. |
132 int channels_; | 132 int channels_; |
133 | 133 |
134 // Sample rate of audio stream. | 134 // Sample rate of audio stream. |
135 int samples_per_second_; | 135 int samples_per_second_; |
136 | 136 |
| 137 // Is compressed audio output |
| 138 bool is_raw_format_; |
| 139 |
137 // Buffered audio data. | 140 // Buffered audio data. |
138 AudioBufferQueue audio_buffer_; | 141 AudioBufferQueue audio_buffer_; |
139 | 142 |
140 // If muted, keep track of partial frames that should have been skipped over. | 143 // If muted, keep track of partial frames that should have been skipped over. |
141 double muted_partial_frame_; | 144 double muted_partial_frame_; |
142 | 145 |
143 // How many frames to have in the queue before we report the queue is full. | 146 // How many frames to have in the queue before we report the queue is full. |
144 int capacity_; | 147 int capacity_; |
145 | 148 |
146 // Book keeping of the current time of generated audio, in frames. This | 149 // Book keeping of the current time of generated audio, in frames. This |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // The initial and maximum capacity calculated by Initialize(). | 213 // The initial and maximum capacity calculated by Initialize(). |
211 int initial_capacity_; | 214 int initial_capacity_; |
212 int max_capacity_; | 215 int max_capacity_; |
213 | 216 |
214 DISALLOW_COPY_AND_ASSIGN(AudioRendererAlgorithm); | 217 DISALLOW_COPY_AND_ASSIGN(AudioRendererAlgorithm); |
215 }; | 218 }; |
216 | 219 |
217 } // namespace media | 220 } // namespace media |
218 | 221 |
219 #endif // MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ | 222 #endif // MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ |
OLD | NEW |