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 "base/macros.h" |
24 #include "base/memory/ref_counted.h" | 25 #include "base/memory/ref_counted.h" |
25 #include "base/memory/scoped_ptr.h" | 26 #include "base/memory/scoped_ptr.h" |
26 #include "media/audio/audio_parameters.h" | 27 #include "media/audio/audio_parameters.h" |
27 #include "media/base/audio_buffer.h" | 28 #include "media/base/audio_buffer.h" |
28 #include "media/base/audio_buffer_queue.h" | 29 #include "media/base/audio_buffer_queue.h" |
29 | 30 |
30 namespace media { | 31 namespace media { |
31 | 32 |
32 class AudioBus; | 33 class AudioBus; |
33 | 34 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 // searched for a block (|optimal_block_|) that is most similar to | 203 // searched for a block (|optimal_block_|) that is most similar to |
203 // |target_block_|. | 204 // |target_block_|. |
204 scoped_ptr<AudioBus> target_block_; | 205 scoped_ptr<AudioBus> target_block_; |
205 | 206 |
206 DISALLOW_COPY_AND_ASSIGN(AudioRendererAlgorithm); | 207 DISALLOW_COPY_AND_ASSIGN(AudioRendererAlgorithm); |
207 }; | 208 }; |
208 | 209 |
209 } // namespace media | 210 } // namespace media |
210 | 211 |
211 #endif // MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ | 212 #endif // MEDIA_FILTERS_AUDIO_RENDERER_ALGORITHM_H_ |
OLD | NEW |