| 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 12 matching lines...) Expand all Loading... |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #ifndef AudioNodeInput_h | 25 #ifndef AudioNodeInput_h |
| 26 #define AudioNodeInput_h | 26 #define AudioNodeInput_h |
| 27 | 27 |
| 28 #include "modules/webaudio/AudioNode.h" | 28 #include "modules/webaudio/AudioNode.h" |
| 29 #include "modules/webaudio/AudioSummingJunction.h" | 29 #include "modules/webaudio/AudioSummingJunction.h" |
| 30 #include "platform/audio/AudioBus.h" | 30 #include "platform/audio/AudioBus.h" |
| 31 #include "wtf/Allocator.h" | 31 #include "wtf/Allocator.h" |
| 32 #include "wtf/HashSet.h" | 32 #include "wtf/HashSet.h" |
| 33 #include <memory> | |
| 34 | 33 |
| 35 namespace blink { | 34 namespace blink { |
| 36 | 35 |
| 37 class AudioNodeOutput; | 36 class AudioNodeOutput; |
| 38 | 37 |
| 39 // An AudioNodeInput represents an input to an AudioNode and can be connected fr
om one or more AudioNodeOutputs. | 38 // An AudioNodeInput represents an input to an AudioNode and can be connected fr
om one or more AudioNodeOutputs. |
| 40 // In the case of multiple connections, the input will act as a unity-gain summi
ng junction, mixing all the outputs. | 39 // In the case of multiple connections, the input will act as a unity-gain summi
ng junction, mixing all the outputs. |
| 41 // The number of channels of the input's bus is the maximum of the number of cha
nnels of all its connections. | 40 // The number of channels of the input's bus is the maximum of the number of cha
nnels of all its connections. |
| 42 | 41 |
| 43 class AudioNodeInput final : public AudioSummingJunction { | 42 class AudioNodeInput final : public AudioSummingJunction { |
| 44 USING_FAST_MALLOC(AudioNodeInput); | 43 USING_FAST_MALLOC(AudioNodeInput); |
| 45 public: | 44 public: |
| 46 static std::unique_ptr<AudioNodeInput> create(AudioHandler&); | 45 static PassOwnPtr<AudioNodeInput> create(AudioHandler&); |
| 47 | 46 |
| 48 // AudioSummingJunction | 47 // AudioSummingJunction |
| 49 void didUpdate() override; | 48 void didUpdate() override; |
| 50 | 49 |
| 51 // Can be called from any thread. | 50 // Can be called from any thread. |
| 52 AudioHandler& handler() const { return m_handler; } | 51 AudioHandler& handler() const { return m_handler; } |
| 53 | 52 |
| 54 // Must be called with the context's graph lock. | 53 // Must be called with the context's graph lock. |
| 55 void connect(AudioNodeOutput&); | 54 void connect(AudioNodeOutput&); |
| 56 void disconnect(AudioNodeOutput&); | 55 void disconnect(AudioNodeOutput&); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // Called from context's audio thread. | 98 // Called from context's audio thread. |
| 100 AudioBus* internalSummingBus(); | 99 AudioBus* internalSummingBus(); |
| 101 void sumAllConnections(AudioBus* summingBus, size_t framesToProcess); | 100 void sumAllConnections(AudioBus* summingBus, size_t framesToProcess); |
| 102 | 101 |
| 103 RefPtr<AudioBus> m_internalSummingBus; | 102 RefPtr<AudioBus> m_internalSummingBus; |
| 104 }; | 103 }; |
| 105 | 104 |
| 106 } // namespace blink | 105 } // namespace blink |
| 107 | 106 |
| 108 #endif // AudioNodeInput_h | 107 #endif // AudioNodeInput_h |
| OLD | NEW |