OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 16 matching lines...) Expand all Loading... |
27 #if ENABLE(WEB_AUDIO) | 27 #if ENABLE(WEB_AUDIO) |
28 | 28 |
29 #include "modules/webaudio/WaveShaperDSPKernel.h" | 29 #include "modules/webaudio/WaveShaperDSPKernel.h" |
30 | 30 |
31 #include "wtf/MainThread.h" | 31 #include "wtf/MainThread.h" |
32 #include "wtf/Threading.h" | 32 #include "wtf/Threading.h" |
33 #include <algorithm> | 33 #include <algorithm> |
34 | 34 |
35 const unsigned RenderingQuantum = 128; | 35 const unsigned RenderingQuantum = 128; |
36 | 36 |
37 using namespace std; | |
38 | |
39 namespace WebCore { | 37 namespace WebCore { |
40 | 38 |
41 WaveShaperDSPKernel::WaveShaperDSPKernel(WaveShaperProcessor* processor) | 39 WaveShaperDSPKernel::WaveShaperDSPKernel(WaveShaperProcessor* processor) |
42 : AudioDSPKernel(processor) | 40 : AudioDSPKernel(processor) |
43 { | 41 { |
44 if (processor->oversample() != WaveShaperProcessor::OverSampleNone) | 42 if (processor->oversample() != WaveShaperProcessor::OverSampleNone) |
45 lazyInitializeOversampling(); | 43 lazyInitializeOversampling(); |
46 } | 44 } |
47 | 45 |
48 void WaveShaperDSPKernel::lazyInitializeOversampling() | 46 void WaveShaperDSPKernel::lazyInitializeOversampling() |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 default: | 200 default: |
203 ASSERT_NOT_REACHED(); | 201 ASSERT_NOT_REACHED(); |
204 } | 202 } |
205 | 203 |
206 return static_cast<double>(latencyFrames) / sampleRate(); | 204 return static_cast<double>(latencyFrames) / sampleRate(); |
207 } | 205 } |
208 | 206 |
209 } // namespace WebCore | 207 } // namespace WebCore |
210 | 208 |
211 #endif // ENABLE(WEB_AUDIO) | 209 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |