| 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 // AudioConverter is a complete mixing, resampling, buffering, and channel | 5 // AudioConverter is a complete mixing, resampling, buffering, and channel |
| 6 // mixing solution for converting data from one set of AudioParameters to | 6 // mixing solution for converting data from one set of AudioParameters to |
| 7 // another. | 7 // another. |
| 8 // | 8 // |
| 9 // For efficiency, pieces are only invoked when necessary; i.e., | 9 // For efficiency, pieces are only invoked when necessary; i.e., |
| 10 // - The resampler is only used if sample rates differ. | 10 // - The resampler is only used if sample rates differ. |
| 11 // - The FIFO is only used if buffer sizes differ. | 11 // - The FIFO is only used if buffer sizes differ. |
| 12 // - The channel mixer is only used if channel layouts differ. | 12 // - The channel mixer is only used if channel layouts differ. |
| 13 // | 13 // |
| 14 // Additionally, since resampling is the most expensive operation, input mixing | 14 // Additionally, since resampling is the most expensive operation, input mixing |
| 15 // and channel down mixing are done prior to resampling. Likewise, channel up | 15 // and channel down mixing are done prior to resampling. Likewise, channel up |
| 16 // mixing is performed after resampling. | 16 // mixing is performed after resampling. |
| 17 | 17 |
| 18 #ifndef MEDIA_BASE_AUDIO_CONVERTER_H_ | 18 #ifndef MEDIA_BASE_AUDIO_CONVERTER_H_ |
| 19 #define MEDIA_BASE_AUDIO_CONVERTER_H_ | 19 #define MEDIA_BASE_AUDIO_CONVERTER_H_ |
| 20 | 20 |
| 21 #include <list> | 21 #include <list> |
| 22 | 22 |
| 23 #include "base/callback.h" | 23 #include "base/callback.h" |
| 24 #include "base/macros.h" | 24 #include "base/macros.h" |
| 25 #include "base/memory/scoped_ptr.h" | 25 #include "base/memory/scoped_ptr.h" |
| 26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
| 27 #include "media/audio/audio_parameters.h" | 27 #include "media/base/audio_parameters.h" |
| 28 #include "media/base/media_export.h" | 28 #include "media/base/media_export.h" |
| 29 | 29 |
| 30 namespace media { | 30 namespace media { |
| 31 | 31 |
| 32 class AudioBus; | 32 class AudioBus; |
| 33 class AudioPullFifo; | 33 class AudioPullFifo; |
| 34 class ChannelMixer; | 34 class ChannelMixer; |
| 35 class MultiChannelResampler; | 35 class MultiChannelResampler; |
| 36 | 36 |
| 37 // Converts audio data between two AudioParameters formats. Sample usage: | 37 // Converts audio data between two AudioParameters formats. Sample usage: |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // value from the input AudioParameters class. Preserved to recreate internal | 142 // value from the input AudioParameters class. Preserved to recreate internal |
| 143 // AudioBus structures on demand in response to varying frame size requests. | 143 // AudioBus structures on demand in response to varying frame size requests. |
| 144 const int input_channel_count_; | 144 const int input_channel_count_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(AudioConverter); | 146 DISALLOW_COPY_AND_ASSIGN(AudioConverter); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 } // namespace media | 149 } // namespace media |
| 150 | 150 |
| 151 #endif // MEDIA_BASE_AUDIO_CONVERTER_H_ | 151 #endif // MEDIA_BASE_AUDIO_CONVERTER_H_ |
| OLD | NEW |