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. |
11 // | 11 // |
12 // AudioRendererAlgorithm uses the Waveform Similarity Overlap and Add (WSOLA) | 12 // AudioRendererAlgorithm uses the Waveform Similarity Overlap and Add (WSOLA) |
13 // algorithm to stretch or compress audio data to meet playback speeds less than | 13 // algorithm to stretch or compress audio data to meet playback speeds less than |
14 // or greater than the natural playback of the audio stream. The algorithm | 14 // or greater than the natural playback of the audio stream. The algorithm |
15 // preserves local properties of the audio, therefore, pitch and harmonics are | 15 // preserves local properties of the audio, therefore, pitch and harmonics are |
16 // are preserved. See audio_renderer_algorith.cc for a more elaborate | 16 // are preserved. See audio_renderer_algorith.cc for a more elaborate |
17 // description of the algorithm. | 17 // description of the algorithm. |
18 // | 18 // |
19 // Audio at very low or very high playback rates are muted to preserve quality. | 19 // Audio at very low or very high playback rates are muted to preserve quality. |
20 | 20 |
21 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ | 21 #ifndef MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ |
22 #define MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ | 22 #define MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ |
23 | 23 |
| 24 #include <stdint.h> |
| 25 |
24 #include "base/macros.h" | 26 #include "base/macros.h" |
25 #include "base/memory/ref_counted.h" | 27 #include "base/memory/ref_counted.h" |
26 #include "base/memory/scoped_ptr.h" | 28 #include "base/memory/scoped_ptr.h" |
27 #include "media/audio/audio_parameters.h" | 29 #include "media/audio/audio_parameters.h" |
28 #include "media/base/audio_buffer.h" | 30 #include "media/base/audio_buffer.h" |
29 #include "media/base/audio_buffer_queue.h" | 31 #include "media/base/audio_buffer_queue.h" |
30 | 32 |
31 namespace media { | 33 namespace media { |
32 | 34 |
33 class AudioBus; | 35 class AudioBus; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // searched for a block (|optimal_block_|) that is most similar to | 205 // searched for a block (|optimal_block_|) that is most similar to |
204 // |target_block_|. | 206 // |target_block_|. |
205 scoped_ptr<AudioBus> target_block_; | 207 scoped_ptr<AudioBus> target_block_; |
206 | 208 |
207 DISALLOW_COPY_AND_ASSIGN(AudioRendererAlgorithm); | 209 DISALLOW_COPY_AND_ASSIGN(AudioRendererAlgorithm); |
208 }; | 210 }; |
209 | 211 |
210 } // namespace media | 212 } // namespace media |
211 | 213 |
212 #endif // MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ | 214 #endif // MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ |
OLD | NEW |