Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(394)

Side by Side Diff: Source/modules/webaudio/AudioNodeOutput.h

Issue 438293003: Enable Oilpan by default for webaudio/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 20 matching lines...) Expand all
31 #include "wtf/HashSet.h" 31 #include "wtf/HashSet.h"
32 #include "wtf/RefPtr.h" 32 #include "wtf/RefPtr.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class AudioContext; 36 class AudioContext;
37 class AudioNodeInput; 37 class AudioNodeInput;
38 38
39 // AudioNodeOutput represents a single output for an AudioNode. 39 // AudioNodeOutput represents a single output for an AudioNode.
40 // It may be connected to one or more AudioNodeInputs. 40 // It may be connected to one or more AudioNodeInputs.
41 class AudioNodeOutput : public NoBaseWillBeGarbageCollectedFinalized<AudioNodeOu tput> { 41 class AudioNodeOutput : public GarbageCollectedFinalized<AudioNodeOutput> {
42 public: 42 public:
43 // It's OK to pass 0 for numberOfChannels in which case 43 // It's OK to pass 0 for numberOfChannels in which case
44 // setNumberOfChannels() must be called later on. 44 // setNumberOfChannels() must be called later on.
45 static PassOwnPtrWillBeRawPtr<AudioNodeOutput> create(AudioNode*, unsigned n umberOfChannels); 45 static AudioNodeOutput* create(AudioNode*, unsigned numberOfChannels);
46 void trace(Visitor*); 46 void trace(Visitor*);
47 47
48 // Can be called from any thread. 48 // Can be called from any thread.
49 AudioNode* node() const { return m_node; } 49 AudioNode* node() const { return m_node; }
50 AudioContext* context() { return m_node->context(); } 50 AudioContext* context() { return m_node->context(); }
51 51
52 // Causes our AudioNode to process if it hasn't already for this render quan tum. 52 // Causes our AudioNode to process if it hasn't already for this render quan tum.
53 // It returns the bus containing the processed audio for this output, return ing inPlaceBus if in-place processing was possible. 53 // It returns the bus containing the processed audio for this output, return ing inPlaceBus if in-place processing was possible.
54 // Called from context's audio thread. 54 // Called from context's audio thread.
55 AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess); 55 AudioBus* pull(AudioBus* inPlaceBus, size_t framesToProcess);
(...skipping 21 matching lines...) Expand all
77 void disable(); 77 void disable();
78 void enable(); 78 void enable();
79 79
80 // updateRenderingState() is called in the audio thread at the start or end of the render quantum to handle any recent changes to the graph state. 80 // updateRenderingState() is called in the audio thread at the start or end of the render quantum to handle any recent changes to the graph state.
81 // It must be called with the context's graph lock. 81 // It must be called with the context's graph lock.
82 void updateRenderingState(); 82 void updateRenderingState();
83 83
84 private: 84 private:
85 AudioNodeOutput(AudioNode*, unsigned numberOfChannels); 85 AudioNodeOutput(AudioNode*, unsigned numberOfChannels);
86 86
87 RawPtrWillBeMember<AudioNode> m_node; 87 Member<AudioNode> m_node;
88 88
89 friend class AudioNodeInput; 89 friend class AudioNodeInput;
90 friend class AudioParam; 90 friend class AudioParam;
91 91
92 // These are called from AudioNodeInput. 92 // These are called from AudioNodeInput.
93 // They must be called with the context's graph lock. 93 // They must be called with the context's graph lock.
94 void addInput(AudioNodeInput&); 94 void addInput(AudioNodeInput&);
95 void removeInput(AudioNodeInput&); 95 void removeInput(AudioNodeInput&);
96 void addParam(AudioParam&); 96 void addParam(AudioParam&);
97 void removeParam(AudioParam&); 97 void removeParam(AudioParam&);
(...skipping 28 matching lines...) Expand all
126 // The main thread sets m_desiredNumberOfChannels which will later get picke d up in the audio thread in updateNumberOfChannels(). 126 // The main thread sets m_desiredNumberOfChannels which will later get picke d up in the audio thread in updateNumberOfChannels().
127 unsigned m_numberOfChannels; 127 unsigned m_numberOfChannels;
128 unsigned m_desiredNumberOfChannels; 128 unsigned m_desiredNumberOfChannels;
129 129
130 // m_internalBus and m_inPlaceBus must only be changed in the audio thread w ith the context's graph lock (or constructor). 130 // m_internalBus and m_inPlaceBus must only be changed in the audio thread w ith the context's graph lock (or constructor).
131 RefPtr<AudioBus> m_internalBus; 131 RefPtr<AudioBus> m_internalBus;
132 RefPtr<AudioBus> m_inPlaceBus; 132 RefPtr<AudioBus> m_inPlaceBus;
133 // If m_isInPlace is true, use m_inPlaceBus as the valid AudioBus; If false, use the default m_internalBus. 133 // If m_isInPlace is true, use m_inPlaceBus as the valid AudioBus; If false, use the default m_internalBus.
134 bool m_isInPlace; 134 bool m_isInPlace;
135 135
136 // This RefPtr<AudioNode> is connection reference. We must call AudioNode:: 136 // This RefPtr<AudioNode> is connection reference. We must call AudioNode::
tkent 2014/08/15 07:39:00 Remove this paragraph.
haraken 2014/08/15 08:08:00 Done.
137 // makeConnection() after ref(), and call AudioNode::breakConnection() 137 // makeConnection() after ref(), and call AudioNode::breakConnection()
138 // before deref(). 138 // before deref().
139 // Oilpan: This HashMap holds connection references. We must call 139 // Oilpan: This HashMap holds connection references. We must call
140 // AudioNode::makeConnection when we add an AudioNode to this, and must call 140 // AudioNode::makeConnection when we add an AudioNode to this, and must call
141 // AudioNode::breakConnection() when we remove an AudioNode from this. 141 // AudioNode::breakConnection() when we remove an AudioNode from this.
142 WillBeHeapHashMap<RawPtrWillBeMember<AudioNodeInput>, RefPtrWillBeMember<Aud ioNode> > m_inputs; 142 HeapHashMap<Member<AudioNodeInput>, Member<AudioNode> > m_inputs;
143 typedef WillBeHeapHashMap<RawPtrWillBeMember<AudioNodeInput>, RefPtrWillBeMe mber<AudioNode> >::iterator InputsIterator; 143 typedef HeapHashMap<Member<AudioNodeInput>, Member<AudioNode> >::iterator In putsIterator;
144 bool m_isEnabled; 144 bool m_isEnabled;
145 145
146 // For the purposes of rendering, keeps track of the number of inputs and Au dioParams we're connected to. 146 // For the purposes of rendering, keeps track of the number of inputs and Au dioParams we're connected to.
147 // These value should only be changed at the very start or end of the render ing quantum. 147 // These value should only be changed at the very start or end of the render ing quantum.
148 unsigned m_renderingFanOutCount; 148 unsigned m_renderingFanOutCount;
149 unsigned m_renderingParamFanOutCount; 149 unsigned m_renderingParamFanOutCount;
150 150
151 WillBeHeapHashSet<RefPtrWillBeMember<AudioParam> > m_params; 151 HeapHashSet<Member<AudioParam> > m_params;
152 }; 152 };
153 153
154 } // namespace blink 154 } // namespace blink
155 155
156 #endif // AudioNodeOutput_h 156 #endif // AudioNodeOutput_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698