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 10 matching lines...) Expand all Loading... |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
23 */ | 23 */ |
24 | 24 |
25 #ifndef AudioBasicProcessorHandler_h | 25 #ifndef AudioBasicProcessorHandler_h |
26 #define AudioBasicProcessorHandler_h | 26 #define AudioBasicProcessorHandler_h |
27 | 27 |
28 #include "modules/ModulesExport.h" | 28 #include "modules/ModulesExport.h" |
29 #include "modules/webaudio/AudioNode.h" | 29 #include "modules/webaudio/AudioNode.h" |
30 #include "wtf/Forward.h" | 30 #include "wtf/Forward.h" |
31 #include <memory> | |
32 | 31 |
33 namespace blink { | 32 namespace blink { |
34 | 33 |
35 class AudioNodeInput; | 34 class AudioNodeInput; |
36 class AudioProcessor; | 35 class AudioProcessor; |
37 | 36 |
38 // AudioBasicProcessorHandler is an AudioHandler with one input and one output | 37 // AudioBasicProcessorHandler is an AudioHandler with one input and one output |
39 // where the input and output have the same number of channels. | 38 // where the input and output have the same number of channels. |
40 class MODULES_EXPORT AudioBasicProcessorHandler : public AudioHandler { | 39 class MODULES_EXPORT AudioBasicProcessorHandler : public AudioHandler { |
41 public: | 40 public: |
42 static PassRefPtr<AudioBasicProcessorHandler> create(NodeType, AudioNode&, f
loat sampleRate, std::unique_ptr<AudioProcessor>); | 41 static PassRefPtr<AudioBasicProcessorHandler> create(NodeType, AudioNode&, f
loat sampleRate, PassOwnPtr<AudioProcessor>); |
43 ~AudioBasicProcessorHandler() override; | 42 ~AudioBasicProcessorHandler() override; |
44 | 43 |
45 // AudioHandler | 44 // AudioHandler |
46 void process(size_t framesToProcess) final; | 45 void process(size_t framesToProcess) final; |
47 void pullInputs(size_t framesToProcess) final; | 46 void pullInputs(size_t framesToProcess) final; |
48 void initialize() final; | 47 void initialize() final; |
49 void uninitialize() final; | 48 void uninitialize() final; |
50 | 49 |
51 // Called in the main thread when the number of channels for the input may h
ave changed. | 50 // Called in the main thread when the number of channels for the input may h
ave changed. |
52 void checkNumberOfChannelsForInput(AudioNodeInput*) final; | 51 void checkNumberOfChannelsForInput(AudioNodeInput*) final; |
53 | 52 |
54 // Returns the number of channels for both the input and the output. | 53 // Returns the number of channels for both the input and the output. |
55 unsigned numberOfChannels(); | 54 unsigned numberOfChannels(); |
56 AudioProcessor* processor() { return m_processor.get(); } | 55 AudioProcessor* processor() { return m_processor.get(); } |
57 | 56 |
58 private: | 57 private: |
59 AudioBasicProcessorHandler(NodeType, AudioNode&, float sampleRate, std::uniq
ue_ptr<AudioProcessor>); | 58 AudioBasicProcessorHandler(NodeType, AudioNode&, float sampleRate, PassOwnPt
r<AudioProcessor>); |
60 double tailTime() const final; | 59 double tailTime() const final; |
61 double latencyTime() const final; | 60 double latencyTime() const final; |
62 | 61 |
63 std::unique_ptr<AudioProcessor> m_processor; | 62 OwnPtr<AudioProcessor> m_processor; |
64 }; | 63 }; |
65 | 64 |
66 } // namespace blink | 65 } // namespace blink |
67 | 66 |
68 #endif // AudioBasicProcessorHandler_h | 67 #endif // AudioBasicProcessorHandler_h |
OLD | NEW |