| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef AudioResamplerKernel_h | 25 #ifndef AudioResamplerKernel_h |
| 26 #define AudioResamplerKernel_h | 26 #define AudioResamplerKernel_h |
| 27 | 27 |
| 28 #include "platform/PlatformExport.h" | 28 #include "platform/PlatformExport.h" |
| 29 #include "platform/audio/AudioArray.h" | 29 #include "platform/audio/AudioArray.h" |
| 30 #include "wtf/Allocator.h" | 30 #include "wtf/Allocator.h" |
| 31 | 31 |
| 32 #if ENABLE(WEB_AUDIO) | |
| 33 | |
| 34 namespace blink { | 32 namespace blink { |
| 35 | 33 |
| 36 class AudioResampler; | 34 class AudioResampler; |
| 37 | 35 |
| 38 // AudioResamplerKernel does resampling on a single mono channel. | 36 // AudioResamplerKernel does resampling on a single mono channel. |
| 39 // It uses a simple linear interpolation for good performance. | 37 // It uses a simple linear interpolation for good performance. |
| 40 | 38 |
| 41 class PLATFORM_EXPORT AudioResamplerKernel { | 39 class PLATFORM_EXPORT AudioResamplerKernel { |
| 42 USING_FAST_MALLOC(AudioResamplerKernel); | 40 USING_FAST_MALLOC(AudioResamplerKernel); |
| 43 WTF_MAKE_NONCOPYABLE(AudioResamplerKernel); | 41 WTF_MAKE_NONCOPYABLE(AudioResamplerKernel); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 72 // We need to have continuity from one call of process() to the next. | 70 // We need to have continuity from one call of process() to the next. |
| 73 // m_lastValues stores the last two sample values from the last call to proc
ess(). | 71 // m_lastValues stores the last two sample values from the last call to proc
ess(). |
| 74 // m_fillIndex represents how many buffered samples we have which can be as
many as 2. | 72 // m_fillIndex represents how many buffered samples we have which can be as
many as 2. |
| 75 // For the first call to process() (or after reset()) there will be no buffe
red samples. | 73 // For the first call to process() (or after reset()) there will be no buffe
red samples. |
| 76 float m_lastValues[2]; | 74 float m_lastValues[2]; |
| 77 unsigned m_fillIndex; | 75 unsigned m_fillIndex; |
| 78 }; | 76 }; |
| 79 | 77 |
| 80 } // namespace blink | 78 } // namespace blink |
| 81 | 79 |
| 82 #endif // ENABLE(WEB_AUDIO) | |
| 83 | |
| 84 #endif // AudioResamplerKernel_h | 80 #endif // AudioResamplerKernel_h |
| OLD | NEW |