| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // pull() processes all of the AudioNodes connected to us. | 64 // pull() processes all of the AudioNodes connected to us. |
| 65 // In the case of multiple connections it sums the result into an internal s
umming bus. | 65 // In the case of multiple connections it sums the result into an internal s
umming bus. |
| 66 // In the single connection case, it allows in-place processing where possib
le using inPlaceBus. | 66 // In the single connection case, it allows in-place processing where possib
le using inPlaceBus. |
| 67 // It returns the bus which it rendered into, returning inPlaceBus if in-pla
ce processing was performed. | 67 // It returns the bus which it rendered into, returning inPlaceBus if in-pla
ce processing was performed. |
| 68 // Called from context's audio thread. | 68 // Called from context's audio thread. |
| 69 AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess); | 69 AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess); |
| 70 | 70 |
| 71 // bus() contains the rendered audio after pull() has been called for each t
ime quantum. | 71 // bus() contains the rendered audio after pull() has been called for each t
ime quantum. |
| 72 // Called from context's audio thread. | 72 // Called from context's audio thread. |
| 73 AudioBus* bus(); | 73 AudioBus* bus(); |
| 74 | 74 |
| 75 // updateInternalBus() updates m_internalSummingBus appropriately for the nu
mber of channels. | 75 // updateInternalBus() updates m_internalSummingBus appropriately for the nu
mber of channels. |
| 76 // This must be called when we own the context's graph lock in the audio thr
ead at the very start or end of the render quantum. | 76 // This must be called when we own the context's graph lock in the audio thr
ead at the very start or end of the render quantum. |
| 77 void updateInternalBus(); | 77 void updateInternalBus(); |
| 78 | 78 |
| 79 // The number of channels of the connection with the largest number of chann
els. | 79 // The number of channels of the connection with the largest number of chann
els. |
| 80 unsigned numberOfChannels() const; | 80 unsigned numberOfChannels() const; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 AudioNode* m_node; | 83 AudioNode* m_node; |
| 84 | 84 |
| 85 // m_disabledOutputs contains the AudioNodeOutputs which are disabled (will
not be processed) by the audio graph rendering. | 85 // m_disabledOutputs contains the AudioNodeOutputs which are disabled (will
not be processed) by the audio graph rendering. |
| 86 // But, from JavaScript's perspective, these outputs are still connected to
us. | 86 // But, from JavaScript's perspective, these outputs are still connected to
us. |
| 87 // Generally, these represent disabled connections from "notes" which have f
inished playing but are not yet garbage collected. | 87 // Generally, these represent disabled connections from "notes" which have f
inished playing but are not yet garbage collected. |
| 88 HashSet<AudioNodeOutput*> m_disabledOutputs; | 88 HashSet<AudioNodeOutput*> m_disabledOutputs; |
| 89 | 89 |
| 90 // Called from context's audio thread. | 90 // Called from context's audio thread. |
| 91 AudioBus* internalSummingBus(); | 91 AudioBus* internalSummingBus(); |
| 92 void sumAllConnections(AudioBus* summingBus, size_t framesToProcess); | 92 void sumAllConnections(AudioBus* summingBus, size_t framesToProcess); |
| 93 | 93 |
| 94 RefPtr<AudioBus> m_internalSummingBus; | 94 RefPtr<AudioBus> m_internalSummingBus; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace WebCore | 97 } // namespace WebCore |
| 98 | 98 |
| 99 #endif // AudioNodeInput_h | 99 #endif // AudioNodeInput_h |
| OLD | NEW |