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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Regardless of the allowed buffer sizes, we still need to process at the g
ranularity of the AudioNode. | 48 // Regardless of the allowed buffer sizes, we still need to process at the g
ranularity of the AudioNode. |
49 if (m_bufferSize < ProcessingSizeInFrames) | 49 if (m_bufferSize < ProcessingSizeInFrames) |
50 m_bufferSize = ProcessingSizeInFrames; | 50 m_bufferSize = ProcessingSizeInFrames; |
51 | 51 |
52 DCHECK_LE(numberOfInputChannels, BaseAudioContext::maxNumberOfChannels()); | 52 DCHECK_LE(numberOfInputChannels, BaseAudioContext::maxNumberOfChannels()); |
53 | 53 |
54 addInput(); | 54 addInput(); |
55 addOutput(numberOfOutputChannels); | 55 addOutput(numberOfOutputChannels); |
56 | 56 |
57 m_channelCount = numberOfInputChannels; | 57 m_channelCount = numberOfInputChannels; |
58 m_channelCountMode = Explicit; | 58 setInternalChannelCountMode(Explicit); |
59 | 59 |
60 initialize(); | 60 initialize(); |
61 } | 61 } |
62 | 62 |
63 PassRefPtr<ScriptProcessorHandler> ScriptProcessorHandler::create(AudioNode& nod
e, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned
numberOfOutputChannels) | 63 PassRefPtr<ScriptProcessorHandler> ScriptProcessorHandler::create(AudioNode& nod
e, float sampleRate, size_t bufferSize, unsigned numberOfInputChannels, unsigned
numberOfOutputChannels) |
64 { | 64 { |
65 return adoptRef(new ScriptProcessorHandler(node, sampleRate, bufferSize, num
berOfInputChannels, numberOfOutputChannels)); | 65 return adoptRef(new ScriptProcessorHandler(node, sampleRate, bufferSize, num
berOfInputChannels, numberOfOutputChannels)); |
66 } | 66 } |
67 | 67 |
68 ScriptProcessorHandler::~ScriptProcessorHandler() | 68 ScriptProcessorHandler::~ScriptProcessorHandler() |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // If |onaudioprocess| event handler is defined, the node should not be | 378 // If |onaudioprocess| event handler is defined, the node should not be |
379 // GCed even if it is out of scope. | 379 // GCed even if it is out of scope. |
380 if (hasEventListeners(EventTypeNames::audioprocess)) | 380 if (hasEventListeners(EventTypeNames::audioprocess)) |
381 return true; | 381 return true; |
382 | 382 |
383 return false; | 383 return false; |
384 } | 384 } |
385 | 385 |
386 } // namespace blink | 386 } // namespace blink |
387 | 387 |
OLD | NEW |