| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 unsigned m_numberOfInputChannels; | 100 unsigned m_numberOfInputChannels; |
| 101 unsigned m_numberOfOutputChannels; | 101 unsigned m_numberOfOutputChannels; |
| 102 | 102 |
| 103 RefPtr<AudioBus> m_internalInputBus; | 103 RefPtr<AudioBus> m_internalInputBus; |
| 104 // Synchronize process() with fireProcessEvent(). | 104 // Synchronize process() with fireProcessEvent(). |
| 105 mutable Mutex m_processEventLock; | 105 mutable Mutex m_processEventLock; |
| 106 | 106 |
| 107 FRIEND_TEST_ALL_PREFIXES(ScriptProcessorNodeTest, BufferLifetime); | 107 FRIEND_TEST_ALL_PREFIXES(ScriptProcessorNodeTest, BufferLifetime); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 class ScriptProcessorNode final : public AudioNode, | 110 class ScriptProcessorNode final |
| 111 public ActiveScriptWrappable { | 111 : public AudioNode, |
| 112 public ActiveScriptWrappable<ScriptProcessorNode> { |
| 112 DEFINE_WRAPPERTYPEINFO(); | 113 DEFINE_WRAPPERTYPEINFO(); |
| 113 USING_GARBAGE_COLLECTED_MIXIN(ScriptProcessorNode); | 114 USING_GARBAGE_COLLECTED_MIXIN(ScriptProcessorNode); |
| 114 | 115 |
| 115 public: | 116 public: |
| 116 // bufferSize must be one of the following values: 256, 512, 1024, 2048, | 117 // bufferSize must be one of the following values: 256, 512, 1024, 2048, |
| 117 // 4096, 8192, 16384. | 118 // 4096, 8192, 16384. |
| 118 // This value controls how frequently the onaudioprocess event handler is | 119 // This value controls how frequently the onaudioprocess event handler is |
| 119 // called and how many sample-frames need to be processed each call. | 120 // called and how many sample-frames need to be processed each call. |
| 120 // Lower numbers for bufferSize will result in a lower (better) | 121 // Lower numbers for bufferSize will result in a lower (better) |
| 121 // latency. Higher numbers will be necessary to avoid audio breakup and | 122 // latency. Higher numbers will be necessary to avoid audio breakup and |
| (...skipping 25 matching lines...) Expand all Loading... |
| 147 ScriptProcessorNode(BaseAudioContext&, | 148 ScriptProcessorNode(BaseAudioContext&, |
| 148 float sampleRate, | 149 float sampleRate, |
| 149 size_t bufferSize, | 150 size_t bufferSize, |
| 150 unsigned numberOfInputChannels, | 151 unsigned numberOfInputChannels, |
| 151 unsigned numberOfOutputChannels); | 152 unsigned numberOfOutputChannels); |
| 152 }; | 153 }; |
| 153 | 154 |
| 154 } // namespace blink | 155 } // namespace blink |
| 155 | 156 |
| 156 #endif // ScriptProcessorNode_h | 157 #endif // ScriptProcessorNode_h |
| OLD | NEW |