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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if (!isInitialized() || !input(0).isConnected()) { | 53 if (!isInitialized() || !input(0).isConnected()) { |
54 outputBus->zero(); | 54 outputBus->zero(); |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 AudioBus* inputBus = input(0).bus(); | 58 AudioBus* inputBus = input(0).bus(); |
59 | 59 |
60 // Give the analyser the audio which is passing through this AudioNode. | 60 // Give the analyser the audio which is passing through this AudioNode. |
61 m_analyser.writeInput(inputBus, framesToProcess); | 61 m_analyser.writeInput(inputBus, framesToProcess); |
62 | 62 |
63 // For in-place processing, our override of pullInputs() will just pass the au
dio data through unchanged if the channel count matches from input to output | 63 // For in-place processing, our override of pullInputs() will just pass the |
64 // (resulting in inputBus == outputBus). Otherwise, do an up-mix to stereo. | 64 // audio data through unchanged if the channel count matches from input to |
| 65 // output (resulting in inputBus == outputBus). Otherwise, do an up-mix to |
| 66 // stereo. |
65 if (inputBus != outputBus) | 67 if (inputBus != outputBus) |
66 outputBus->copyFrom(*inputBus); | 68 outputBus->copyFrom(*inputBus); |
67 } | 69 } |
68 | 70 |
69 void AnalyserHandler::setFftSize(unsigned size, | 71 void AnalyserHandler::setFftSize(unsigned size, |
70 ExceptionState& exceptionState) { | 72 ExceptionState& exceptionState) { |
71 if (!m_analyser.setFftSize(size)) { | 73 if (!m_analyser.setFftSize(size)) { |
72 exceptionState.throwDOMException( | 74 exceptionState.throwDOMException( |
73 IndexSizeError, | 75 IndexSizeError, |
74 (size < RealtimeAnalyser::MinFFTSize || | 76 (size < RealtimeAnalyser::MinFFTSize || |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 235 |
234 void AnalyserNode::getFloatTimeDomainData(DOMFloat32Array* array) { | 236 void AnalyserNode::getFloatTimeDomainData(DOMFloat32Array* array) { |
235 analyserHandler().getFloatTimeDomainData(array); | 237 analyserHandler().getFloatTimeDomainData(array); |
236 } | 238 } |
237 | 239 |
238 void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array) { | 240 void AnalyserNode::getByteTimeDomainData(DOMUint8Array* array) { |
239 analyserHandler().getByteTimeDomainData(array); | 241 analyserHandler().getByteTimeDomainData(array); |
240 } | 242 } |
241 | 243 |
242 } // namespace blink | 244 } // namespace blink |
OLD | NEW |